/* Basic Reset & Base Styles */
:root {
    /* Light Mode Colors */
    --background-color-light: #f8f9fa;
    --text-color-light: #343a40;
    --primary-color-light: #007bff;
    --secondary-background-light: #ffffff;
    
    --header-bg-light: #343a40;
    --header-text-light: #ffffff;
    --skill-tag-bg-light: #e0e0e0;
    --skill-tag-text-light: #343a40;
    --button-bg-light: #007bff;
    --button-text-light: #ffffff;
    --link-color-light: #007bff;
    --footer-bg-light: #343a40;
    --footer-text-light: #ffffff;

    /* Dark Mode Colors (Default) */
    --background-color: #1a1a2e; /* Deep dark blue */
    --text-color: #e0e0e0;      /* Light gray */
    --primary-color: #4CAF50;   /* Green for accents */
    --secondary-background: #16213e; /* Slightly lighter dark blue for sections */
    --border-color: #0f3460;    /* Darker blue for borders/dividers */
    --header-bg: #0f3460;       /* Darker blue for header */
    --header-text: #ffffff;    /* White text for header */
    --skill-tag-bg: #0d1a2f;    /* Even darker for skill tags */
    --skill-tag-text: #e0e0e0;  /* Light text for skill tags */
    --button-bg: #e94560;       /* Reddish-pink for buttons */
    --button-text: #ffffff;    /* White text for buttons */
    --link-color: #70a1ff;      /* Lighter blue for links */
    --footer-bg: #0f3460;       /* Darker blue for footer */
    --footer-text: #ffffff;    /* White text for footer */

    /* Font sizes */
    --font-size-base: 1rem;
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
}

/* Light mode overrides */
body.light-mode {
    --background-color: var(--background-color-light);
    --text-color: var(--text-color-light);
    --primary-color: var(--primary-color-light);
    --secondary-background: var(--secondary-background-light);
    --border-color: var(--border-color-light);
    --header-bg: var(--header-bg-light);
    --header-text: var(--header-text-light);
    --skill-tag-bg: var(--skill-tag-bg-light);
    --skill-tag-text: var(--skill-tag-text-light);
    --button-bg: var(--button-bg-light);
    --button-text: var(--button-text-light);
    --link-color: var(--link-color-light);
    --footer-bg: var(--footer-bg-light);
    --footer-text: var(--footer-text-light);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    filter: brightness(1.2);
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }

.text-center {
    text-align: center;
}

/* Header */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--header-text);
    margin: 0;
}

header nav ul {
    display: flex;
}

header nav ul li {
    margin-left: 25px;
}

header nav ul li a {
    color: var(--header-text);
    font-weight: 400;
    padding: 5px 0;
    position: relative;
}

header nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease-in-out;
}

header nav ul li a:hover::after,
header nav ul li a.active::after {
    width: 100%;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-button {
    background: none;
    border: 1px solid var(--header-text);
    color: var(--header-text);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.toggle-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn-primary {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--button-bg);
    color: var(--button-bg);
}

.btn-secondary:hover {
    background-color: var(--button-bg);
    color: var(--button-text);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    background-color: var(--secondary-background);
    text-align: center;
    padding: 80px 20px;
    border-bottom: 1px solid var(--border-color);
}

.hero-section h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--primary-color);
}

.hero-section p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.25rem;
    opacity: 0.9;
}

/* General Section Styling */
.section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.section:last-of-type {
    border-bottom: none;
}

.section h2 {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 10px;
}

.section h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    border-radius: 2px;
}

/* Experience Section */
.experience-item {
    background-color: var(--secondary-background);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.experience-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.experience-item .period {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 15px;
}

/* About Section */
#about ul {
    margin-top: 15px;
    padding-left: 20px;
}
#about ul li {
    margin-bottom: 8px;
    position: relative;
}
#about ul li::before {
    content: "•"; /* Bullet point */
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}


/* Skills Section */
.skills-category {
    background-color: var(--secondary-background);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.skills-category h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: left; /* Override section h2 center */
    padding-bottom: 0;
}
.skills-category h3::after {
    content: none; /* Remove underline for skill category titles */
}

.skills-category h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--text-color);
    opacity: 0.9;
}

.skill-tag {
    display: inline-block;
    background-color: var(--skill-tag-bg);
    color: var(--skill-tag-text);
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.skill-tag.skill-lang {
    background-color: #e94560; /* Specific color for languages */
    color: #fff;
}
.light-mode .skill-tag.skill-lang {
    background-color: #dc3545; /* Lighter red for languages in light mode */
}

.skill-tag.skill-tech {
    background-color: #0d1a2f; /* Specific color for technologies */
    color: #fff;
}
.light-mode .skill-tag.skill-tech {
    background-color: #28a745; /* Green for technologies in light mode */
}

/* Download CV Section */
.download-section {
    background-color: var(--secondary-background);
    padding: 60px 0;
}
.download-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Contact Section */
.contact-section {
    background-color: var(--background-color);
    padding-bottom: 80px; /* Adjust padding if footer is close */
}

.contact-info {
    text-align: center;
    margin-top: 30px;
}

.contact-info p {
    font-size: 1.15rem;
    margin-bottom: 15px;
}

.contact-info p i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.3rem;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Mobile Navigation Styles */
#hamburger-btn {
    display: none; /* Hidden by default, shown on mobile */
}

.mobile-controls {
    display: none; /* Hidden by default, shown on mobile */
}

.mobile-contact-btn {
    display: none; /* Hidden by default, shown on mobile */
}

/* Responsive Design */
@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    header nav ul {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    header nav ul li {
        margin-left: 0;
    }
    .controls {
        margin-top: 15px;
        justify-content: center;
    }
    .hero-section h2 {
        font-size: 2.8rem;
    }
    .hero-section p {
        font-size: 1.1rem;
    }
    .section {
        padding: 60px 0;
    }
    .section h2 {
        margin-bottom: 40px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: row; /* Volver a fila para alinear logo, controles y contacto */
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px; /* Reducir un poco el padding vertical */
    }

    .logo {
        font-size: 1.8rem; /* Aumentar el tamaño del logo en móvil */
        margin-left: 0; /* Ajustar margen */
    }

    .mobile-controls {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .toggle-button {
        font-size: 1.2rem; /* Aumentar el tamaño de los botones de idioma/tema */
        padding: 10px 15px;
        border: none; /* Quitar borde para un aspecto más limpio */
        background-color: var(--header-bg); /* Mantener el fondo del header */
        color: var(--header-text);
    }

    #hamburger-btn {
        display: block; /* Mostrar el botón hamburguesa */
    }

    header nav {
        display: none; /* Ocultar la navegación por defecto en móvil */
        width: 100%;
        background-color: var(--header-bg);
        position: absolute;
        top: 60px; /* Ajustar según la altura del header */
        left: 0;
        z-index: 999;
        padding: 10px 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    header nav.open {
        display: block; /* Mostrar la navegación cuando la clase 'open' esté presente */
    }

    header nav ul {
        flex-direction: column;
        align-items: stretch; /* Ocupar todo el ancho */
        padding: 0;
        margin: 0;
    }

    header nav ul li {
        margin-left: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    header nav ul li:last-child {
        border-bottom: none;
    }

    header nav ul li a {
        display: block;
        padding: 15px 20px;
        text-align: center;
    }

    .contact-btn {
        display: none; /* Ocultar el botón de contacto grande */
    }

    .mobile-contact-btn {
        display: block; /* Mostrar el botón de contacto en la parte inferior */
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        border-radius: 50px;
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .hero-section h2 {
        font-size: 2.2rem;
    }
    .hero-section p {
        font-size: 1rem;
    }
    .section {
        padding: 40px 0;
    }
    .section h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    .skill-tag {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }
    .btn-secondary {
        width: 80%; /* Make buttons take more width */
        max-width: 300px;
    }
}

/* Estilos para pantallas más grandes */
@media (min-width: 769px) {
    #hamburger-btn {
        display: none; /* Ocultar el botón hamburguesa en pantallas grandes */
    }
    .mobile-nav {
        display: block; /* Mostrar la navegación normal en pantallas grandes */
    }
    .mobile-controls {
        display: none; /* Ocultar los controles reorganizados en pantallas grandes */
    }
    .mobile-contact-btn {
        display: none; /* Ocultar el botón de contacto móvil en pantallas grandes */
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    .toggle-button {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    .hero-section {
        padding: 50px 15px;
    }
    .hero-section h2 {
        font-size: 1.8rem;
    }
    .hero-section p {
        font-size: 0.9rem;
    }
    .section {
        padding: 30px 0;
    }
    .experience-item, .skills-category {
        padding: 20px;
    }
}

/* Keep contact button on scroll */
.contact-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-radius: 50px; /* Make it rounded */
    padding: 15px 25px;
    font-size: 1.1rem;
}