/* ========================================= */
/*          VARIABLES Y CONFIGURACIÓN        */
/* ========================================= */
:root {
    /* Paleta de Colores Moderna (Tema Electricidad/Industrial) */
    --primary-color: #D32F2F;
    /* Rojo Intenso */
    --secondary-color: #1A237E;
    /* Azul Profundo */
    --accent-color: #FFC107;
    /* Amarillo/Dorado Eléctrico */

    --text-dark: #1e293b;
    /* Texto oscuro para lectura */
    --text-light: #64748b;
    /* Texto secundario */
    --white: #ffffff;

    --bg-body: #f8fafc;
    /* Fondo gris muy suave */
    --bg-card: #ffffff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-body);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ========================================= */
/*               NAVEGACIÓN                  */
/* ========================================= */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 35, 126, 0.95);
    /* Azul con transparencia */
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    height: 70px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--accent-color);
    padding: 5px 10px;
    border-radius: 4px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--white);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

/* Efecto de línea animada bajo los enlaces */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    /* Oculto en escritorio */
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ========================================= */
/*                 HEADER (HERO)             */
/* ========================================= */
header {
    height: 100vh;
    min-height: 500px;
    /* Evitar que sea muy corto en landscape */
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Patrón de fondo opcional o imagen */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Imagenes/electricity-1962704_1280.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    /* Imagen sutil de fondo */
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h2 {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-scroll {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid var(--white);
    color: var(--white);
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-scroll:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ========================================= */
/*                SECCIONES                  */
/* ========================================= */
section {
    padding: 80px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.center-title-cont {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.2rem;
    color: var(--secondary-color);
    display: inline-block;
    position: relative;
    margin-bottom: 10px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-top: -30px;
    margin-bottom: 40px;
}

/* ========================================= */
/*                SOBRE MÍ                   */
/* ========================================= */
.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.about-content p {
    margin-bottom: 20px;
}

/* ========================================= */
/*              EXPERIENCIA (TIMELINE)       */
/* ========================================= */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Línea vertical */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    /* Ajuste para móvil por defecto */
    width: 2px;
    background: #e2e8f0;
}

.experience-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    margin-left: 50px;
    /* Espacio para la línea */
    position: relative;
    transition: var(--transition);
}

/* Punto en la línea de tiempo */
.experience-card::before {
    content: '';
    position: absolute;
    left: -56px;
    /* Ajustar posición del punto */
    top: 25px;
    width: 14px;
    height: 14px;
    background: var(--white);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.experience-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-header h3 {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.company {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin: 5px 0;
}

.date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 15px;
    font-style: italic;
}

.experience-card ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-dark);
}

.center-btn {
    text-align: center;
    margin-top: 40px;
}

.btn-primary {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ========================================= */
/*           GALERÍA (NUEVO)                 */
/* ========================================= */
.gallery-container {
    width: 100%;
    overflow-x: auto;
    /* Scroll horizontal */
    padding: 20px 0;
    /* Ocultar barra de scroll estándar pero permitir scroll */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) #e0e0e0;
}

.gallery-track {
    display: flex;
    gap: 20px;
    padding: 10px;
    width: max-content;
    /* Se ajusta al contenido */
}

.gallery-item {
    width: 300px;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    /* No encoger */
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Efecto Zoom al pasar el mouse */
.gallery-item:hover img {
    transform: scale(1.15);
    /* Zoom del 115% */
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    color: var(--white);
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* ========================================= */
/*              FORMACIÓN (GRID)             */
/* ========================================= */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.education-grid .experience-card {
    margin-left: 0;
    border-left: none;
    border-top: 4px solid var(--accent-color);
}

.education-grid .experience-card::before {
    display: none;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 10px;
}

/* ========================================= */
/*              HABILIDADES (GRID)           */
/* ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.skill-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.skill-item i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.skill-item:hover {
    transform: translateY(-5px);
    background: var(--secondary-color);
    color: var(--white);
}

.skill-item:hover i {
    color: var(--accent-color);
}

/* ========================================= */
/*              CONTACTO (NUEVO)             */
/* ========================================= */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    /* 2 columnas: info y formulario */
    gap: 30px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    /* Para que los bordes redondeados funcionen */
}

/* Caja de información (Izquierda) */
.contact-info-box {
    background: var(--secondary-color);
    color: var(--white);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-info-box h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    width: 30px;
    /* Ancho fijo para alineación */
    text-align: center;
}

.info-item h4 {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 2px;
}

.info-item p {
    font-size: 1rem;
    font-weight: 500;
}

/* Caja de Formulario (Derecha) */
.contact-form-box {
    padding: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    resize: none;
    /* Desactivar redimensionamiento */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background: #b71c1c;
    /* Rojo más oscuro */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================= */
/*                 FOOTER                    */
/* ========================================= */
footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 80px 20px 0;
    position: relative;
    margin-top: 50px;
}

.footer-main {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* Estilos para textos en fondo oscuro */
.white-title {
    color: var(--accent-color) !important;
    /* Cambio a Dorado para mejor visibilidad y estilo */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.white-title::after {
    background: var(--white) !important;
    /* Subrayado blanco para contrastar con el dorado */
}

.white-text {
    color: rgba(255, 255, 255, 0.95) !important;
    /* Casi blanco puro para máxima legibilidad */
    font-weight: 500;
}

/* Copyright Bar */
.footer-copyright {
    background: rgba(0, 0, 0, 0.3);
    /* Un poco más oscuro para separar */
    padding: 25px;
    text-align: center;
    font-size: 1rem;
    /* Un poco más grande */
    color: var(--white);
    /* Blanco total */
    font-weight: 500;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
    /* Un toque de elegancia */
}

/* Redes Sociales en Footer */
.social-links-footer {
    display: none;
    /* Ocultar completamente */
}

/* ========================================= */
/*              ANIMACIONES                  */
/* ========================================= */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================= */
/*              RESPONSIVE MEJORADO          */
/* ========================================= */
@media (max-width: 768px) {

    /* Header */
    header h1 {
        font-size: 2.2rem;
        /* Fuente más pequeña */
    }

    header h2 {
        font-size: 1.2rem;
    }

    /* Navegación */
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background: var(--secondary-color);
        width: 100%;
        text-align: center;
        padding: 20px 0;
        transition: 0.3s;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        gap: 0;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin: 15px 0;
    }

    /* Secciones Generales */
    section {
        padding: 50px 20px;
        /* Menos padding vertical */
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* Timeline Experiencia */
    .timeline::before {
        left: 15px;
    }

    .experience-card {
        margin-left: 35px;
        /* Ajuste para espacio reducido */
        padding: 20px;
    }

    .experience-card::before {
        left: -44px;
        /* Ajuste del punto */
    }

    /* Grids */
    .education-grid {
        grid-template-columns: 1fr;
        /* Una sola columna */
    }

    /* Galería */
    .gallery-item {
        width: 250px;
        /* Imágenes más pequeñas */
        height: 180px;
    }

    /* Contacto */
    .contact-container {
        grid-template-columns: 1fr;
        /* Una sola columna */
    }

    .contact-info-box {
        padding: 30px;
    }

    .contact-form-box {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .contact-info {
        flex-direction: column;
        gap: 10px;
    }

    .timeline::before {
        left: 10px;
    }

    .experience-card {
        margin-left: 25px;
        padding: 15px;
    }

    .experience-card::before {
        width: 10px;
        height: 10px;
        left: -32px;
        top: 28px;
        border-width: 2px;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        /* Dos columnas en móviles pequeños */
    }
}