/* Variables de colores */
[data-theme="light"] {
    --background-color: #f4f4f9;
    --text-color: #333;
    --header-background: #ffffff;
    --header-text-color: #2793df;
    --section-background: #fff;
    --section-border: #ddd;
    --button-background: #2793df;
    --button-hover: #1a6fb3;
    --button-text-color: #fff;
}

[data-theme="dark"] {
    --background-color: #1e1e1e;
    --text-color: #f4f4f9;
    --header-background: #2793df;
    --header-text-color: #fff;
    --section-background: #2c2c2c;
    --section-border: #444;
    --button-background: #2793df;
    --button-hover: #1a6fb3;
    --button-text-color: #fff;
}

/* Estilos base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
}

/* Header y navegación responsive */
header {
    background: var(--header-background);
    color: var(--header-text-color);
    border-bottom: 2px solid var(--header-text-color);
    padding: clamp(10px, 3vw, 20px) 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(5px, 2vw, 10px);
    padding: 0 clamp(10px, 3vw, 20px);
}

.logo {
    width: clamp(50px, 10vw, 70px);
    height: auto;
    aspect-ratio: 1/1;
}

h1 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--header-text-color);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: clamp(10px, 3vw, 20px) 0 0;
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 20px);
    flex-wrap: wrap;
}

nav a {
    color: var(--header-text-color);
    text-decoration: none;
    font-weight: bold;
    padding: clamp(8px, 2vw, 10px) clamp(15px, 3vw, 20px);
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Secciones responsivas */
section {
    padding: clamp(15px, 4vw, 30px);
    margin: clamp(15px, 4vw, 30px) auto;
    max-width: min(90%, 800px);
    background: var(--section-background);
    border: 1px solid var(--section-border);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    color: var(--header-text-color);
    margin-bottom: clamp(10px, 3vw, 15px);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    text-align: center;
}

/* Formulario de contacto responsive */
#contactForm {
    display: flex;
    flex-direction: column;
    gap: clamp(15px, 3vw, 20px);
    max-width: min(100%, 600px);
    margin: 0 auto;
    padding: clamp(10px, 2vw, 20px);
}

#contactForm label {
    font-weight: bold;
    margin-bottom: clamp(3px, 1vw, 5px);
    color: var(--text-color);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

#contactForm input,
#contactForm textarea {
    width: 100%;
    padding: clamp(8px, 2vw, 12px);
    border: 1px solid var(--section-border);
    border-radius: 5px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    background-color: var(--section-background);
    color: var(--text-color);
}

#contactForm textarea {
    height: clamp(100px, 30vh, 150px);
}

#contactForm button {
    padding: clamp(10px, 2vw, 12px) clamp(15px, 3vw, 20px);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Footer responsive */
footer {
    text-align: center;
    padding: clamp(15px, 3vw, 20px) 0;
    background: var(--header-background);
    color: var(--header-text-color);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

/* Media Queries específicas */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    nav a {
        display: block;
        width: 100%;
        text-align: center;
    }

    .logo-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    section {
        padding: 15px;
        margin: 15px auto;
    }

    #contactForm input,
    #contactForm textarea {
        font-size: 16px; /* Previene zoom en iOS */
    }

    .logo {
        width: 50px;
    }
}

/* Ajustes de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Soporte para pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background-color: #1e1e1e;
        --text-color: #f4f4f9;
        --header-background: #2793df;
        --header-text-color: #fff;
        --section-background: #2c2c2c;
        --section-border: #444;
    }
}

/* Theme toggle button styles */
#themeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#themeToggle:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    #themeToggle {
        top: 10px;
        right: 10px;
    }
}


/* Add these styles after your existing CSS */

.section-collapsible {
    cursor: pointer;
    position: relative;
    padding: 20px;
    margin: 10px 0;
    background: var(--section-background);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.section-collapsible::after {
    content: '➕';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.section-collapsible.active::after {
    content: '➖';
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 20px;
}

.section-content.active {
    max-height: 1000px;
    padding: 20px;
}

.section-title {
    margin: 0;
    color: var(--header-text-color);
    font-size: 1.5rem;
}