/* --- 1. VARIABLES Y COLORES --- */
:root {
    /* Paleta de Colores - Modo Claro */
    --primary-color: #007BFF;       /* Azul principal */
    --primary-hover: #0056b3;       /* Azul más oscuro para hover */
    --secondary-color: #6c757d;     /* Gris secundario */
    
    /* Fondos */
    --bg-body: #ffffff;
    --bg-alt: #f4f6f9;              /* Gris muy suave para alternar secciones */
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.9); /* Navegación semitransparente */
    
    /* Textos */
    --text-main: #212529;           /* Casi negro, mejor que negro puro */
    --text-muted: #666666;
    --text-light: #ffffff;
    
    /* Bordes y Sombras */
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* Overlay Hero */
    --hero-overlay: rgba(0, 0, 0, 0.7);
}

/* Paleta de Colores - Modo Oscuro */
body.dark-mode {
    --primary-color: #4da3ff;       /* Azul más brillante para contraste */
    --primary-hover: #7abaff;
    --secondary-color: #aab2b9;
    
    /* Fondos Oscuros (Evitamos negro puro #000) */
    --bg-body: #121212;
    --bg-alt: #1a1a1a;
    --bg-card: #242424;
    --bg-nav: rgba(18, 18, 18, 0.9);
    
    /* Textos Oscuros */
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    
    /* Bordes y Sombras Oscuros */
    --border-color: #333333;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.6);
}

/* --- 2. RESET Y ESTILOS GLOBALES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html {
    scroll-behavior: smooth; /* Desplazamiento suave al hacer click en enlaces */
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-body);
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

strong {
    color: var(--primary-color);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* --- 3. BARRA DE NAVEGACIÓN (STICKY & BLUR) --- */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--bg-nav);
    backdrop-filter: blur(10px); /* Efecto cristal */
    -webkit-backdrop-filter: blur(10px); /* Soporte Safari */
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    margin-left: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Efecto subrayado animado en el menú */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Botón Toggle Dark Mode */
.btn-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-toggle:hover {
    background-color: var(--bg-alt);
    transform: rotate(15deg);
}

/* --- 4. HERO SECTION --- */
.hero {
    background-image: url('resources/programacion.png');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 120px 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh; /* Ocupa al menos el 60% de la altura de la pantalla */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--hero-overlay);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem; /* Texto más grande */
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    color: #f0f0f0;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* --- 5. COMPONENTES: SECCIONES Y TITULOS --- */
.section {
    padding: 80px 20px; /* Más espaciado vertical */
    max-width: 1100px;
    margin: 0 auto;
}

.bg-alt {
    background-color: var(--bg-alt);
}

h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-main);
    position: relative;
    display: table; /* Truco para centrar y ajustar ancho */
    margin-left: auto;
    margin-right: auto;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.subtitle {
    text-align: center;
    margin-top: -30px; /* Acercarlo al título h2 */
    margin-bottom: 50px;
    font-style: italic;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* --- 6. TARJETAS: EXPERIENCIA Y PROYECTOS --- */
.timeline-item, .project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    border-radius: 12px; /* Bordes más redondeados */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efecto Hover en las tarjetas */
.timeline-item:hover, .project-card:hover {
    transform: translateY(-5px); /* Se levanta un poco */
    box-shadow: var(--shadow-lg); /* Sombra más fuerte */
    border-color: var(--primary-color); /* Borde sutil de color */
}

/* Experiencia */
.timeline-item {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    border-left: 5px solid var(--primary-color);
}

.timeline-content {
    flex: 1;
}

.timeline-content h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.periodo {
    display: inline-block;
    background-color: var(--bg-alt);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content ul {
    margin-left: 20px;
    margin-top: 10px;
    color: var(--text-muted);
}

.timeline-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
}

.timeline-image img {
    max-width: 150px;
    border-radius: 8px;
}

/* Proyectos */
.project-card {
    display: flex;
    gap: 0; /* Quitamos gap para que la imagen pegue al borde */
    margin-bottom: 60px;
    align-items: stretch; /* Estirar para igualar alturas */
}

.project-image {
    width: 45%; /* Imagen ocupa casi la mitad */
    object-fit: cover;
    min-height: 300px;
}

.project-info {
    padding: 30px;
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-info h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.project-info p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* --- 7. SOBRE MÍ --- */
.sobre-mi-container {
    display: flex;
    align-items: center;
    gap: 50px;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.profile-img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--bg-alt);
    box-shadow: var(--shadow-md);
}

/* --- 8. CONTACTO Y FOOTER --- */
.contacto-info {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.contacto-info p {
    margin: 10px 0;
}

.large-social {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.large-social a {
    font-size: 3rem;
    color: var(--text-main);
    transition: transform 0.3s, color 0.3s;
}

.large-social a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

footer {
    background-color: #111; /* Negro casi puro */
    color: #bbb;
    text-align: center;
    padding: 40px 20px;
    border-top: 4px solid var(--primary-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.ai-disclaimer {
    color: #666;
    margin-top: 10px;
    font-size: 0.8rem;
}

/* --- 9. BOTONES --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px; /* Botones redondos modernos */
    text-decoration: none;
    font-weight: 600;
    margin: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border-color: white;
    color: white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-color);
}

.btn-project {
    padding: 8px 20px;
    font-size: 0.9rem;
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-project:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- 10. AVISO DE COOKIES (FIXED) --- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px; /* No ocupar todo el ancho */
    margin: 0 auto; /* Centrado si la pantalla es grande */
    
    /* COLORES FIJOS PARA LEGIBILIDAD */
    background-color: #222222; 
    color: #ffffff;
    
    padding: 20px;
    border-radius: 10px; /* Bordes redondeados */
    display: flex;
    flex-direction: column; /* Texto arriba, botón abajo en móvil */
    align-items: center;
    gap: 15px;
    z-index: 9999;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border: 1px solid #444;
}

@media (min-width: 768px) {
    .cookie-banner {
        flex-direction: row; /* Al lado en escritorio */
        text-align: left;
    }
}

.cookie-banner.hidden {
    display: none;
}

.cookie-banner p {
    color: #dddddd; /* Texto gris claro fijo */
    font-size: 0.9rem;
    margin: 0;
}

.btn-small {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.btn-small:hover {
    background-color: var(--primary-hover);
}

/* --- 11. RESPONSIVE (CELULAR) --- */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 0;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-links a {
        margin: 5px 10px;
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    /* Stackear elementos verticalmente */
    .timeline-item, 
    .project-card, 
    .project-card.reverse-layout,
    .sobre-mi-container {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    /* Imagen Timeline */
    .timeline-image {
        margin-top: 20px;
        order: -1; /* Poner imagen arriba */
    }

    /* Imagen Proyecto */
    .project-image {
        width: 100%;
        height: 200px;
    }
    
    .project-info {
        width: 100%;
    }

    /* Sobre mí */
    .sobre-mi-texto {
        order: 2;
    }
    .sobre-mi-imagen {
        order: 1;
        margin-bottom: 20px;
    }
    
    .timeline-item {
        border-left: none;
        border-top: 5px solid var(--primary-color);
    }
}