/* Variables */
:root {
    --primary: #0e4f6e;
    --secondary: #1a8cff;
    --accent: #002f86;
    --light: #f5f9fc;
    --dark: #1a1a2e;
    --text: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;

    /* Variables para modo claro (por defecto) */
    --bg-color: var(--light);
    --text-color: var(--text);
    --card-bg: white;
    --header-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --footer-bg: var(--dark);
    --footer-text: white;
    --section-spacing: 40px;
}

/* Clase para modo oscuro */
.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --header-gradient: linear-gradient(135deg, #072a3a, #0a4a85);
    --footer-bg: #0a0a14;
    --footer-text: #e0e0e0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: var(--secondary);
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--header-gradient);
    color: white;
    padding: 120px 0 80px;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background-color: white;
    border: 4px solid white;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.profile-pic:hover img {
    transform: scale(1.05);
}

.dark-mode .profile-pic {
    border-color: var(--card-bg);
}

.name {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards 0.2s;
}

.title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards 0.4s;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards 0.6s;
}

.download-cv {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: var(--shadow);
    width: 40px;
    height: 40px;
}

.download-cv:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    background: #ff5252;
    color: white;
}

.cv-icon {
    margin-right: 8px;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-5px);
}

/* Sections */
section {
    padding: 40px 0;
    margin-bottom: var(--section-spacing);
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    color: var(--primary);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--accent);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* About */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.8;
}

/* Skills */
.skills-subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary);
}

.skills-tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.skills-tab {
    padding: 10px 20px;
    background-color: var(--card-bg);
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.skills-tab.active {
    background-color: var(--primary);
    color: white;
}

.skills-content {
    display: none;
}

.skills-content.active {
    display: block;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.skill-icon-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    transition: var(--transition);
}

.skill-icon-circle:hover {
    transform: translateY(-10px);
}

.skill-icon-circle img {
    width: 60%;
    height: 60%;
}

.skill-icon-item h3 {
    margin-bottom: 5px;
    color: var(--text-color);
}

.skill-icon-item p {
    color: var(--secondary);
    font-size: 0.9rem;
}

.dark-mode .skill-icon-circle {
    background-color: #2a2a2a;
}

.dark-mode .skill-icon-circle img {
    filter: brightness(0.9);
}

/* Experience */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 20px 30px;
    position: relative;
    width: calc(50% - 30px);
    margin-bottom: 20px;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background: var(--secondary);
    border-radius: 50%;
    top: 30px;
    z-index: 1;
}

.timeline-item:nth-child(even):before {
    left: -10px;
}

.timeline-content {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.timeline-date {
    color: var(--secondary);
    font-weight: bold;
    margin-bottom: 10px;
}

.timeline-title {
    color: var(--primary);
    margin-bottom: 10px;
}

.timeline-description ul {
    margin-left: 20px;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-image:hover img {
    transform: scale(1.05);
}

.project-image:empty::before {
    content: attr(data-text);
    color: white;
    font-size: 32px;
}

.project-content {
    padding: 25px;
}

.project-title {
    color: var(--primary);
    margin-bottom: 10px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.project-tag {
    background: var(--light);
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    transition: var(--transition);
}

.project-button:hover {
    background: #1a8cff;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.dark-mode .project-button {
    background: var(--primary);
    color: white;
}

.dark-mode .project-button:hover {
    background: #1a8cff;
}

/* Education */
.education-container {
    max-width: 800px;
    margin: 0 auto;
}

.education-item {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
}

.education-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.education-date {
    color: var(--secondary);
    font-weight: bold;
    margin-bottom: 10px;
}

.education-title {
    color: var(--primary);
    margin-bottom: 10px;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary);
    transition: var(--transition);
}

.dark-mode .contact-icon {
    background: var(--primary);
    color: var(--light);
}

.dark-mode .contact-item a {
    color: var(--light);
}

.dark-mode .contact-item a:hover {
    color: var(--secondary);
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, textarea {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

textarea {
    height: 150px;
    resize: vertical;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

button:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    border: none;
    font-size: 24px;
    color: var(--text-color);
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    font-size: 20px;
    z-index: 999;
    transition: all 0.5s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top i {
    line-height: 1;
    margin: 0;
}

/* Media Queries */
@media (max-width: 768px) {
    section {
        padding: 30px 0;
        margin-bottom: 20px;
    }
    
    .dark-mode-toggle {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }

    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-item:nth-child(odd):before,
    .timeline-item:nth-child(even):before {
        left: 22px;
        right: auto;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
} 