/* =================================================================
   style.css - Portafolio Luca Jallinsky
   ================================================================= */

/* 1. VARIABLES DE TEMA Y ESTILOS GLOBALES */

/* Light Mode (Predeterminado) */
:root {
    --color-primary: #1a50a3; 
    --color-secondary: #ff7f11; 
    --color-bg: #f3f4f6;      
    --color-card-bg: #ffffff; 
    --color-text: #282c35;    
    --color-subtle-text: #6b7280; 
    --color-border: #e5e7eb;  
}

/* Dark Mode (Aplicado por script.js mediante [data-theme="dark"]) */
[data-theme="dark"] {
    --color-primary: #5c97ff; 
    --color-secondary: #ff9d47; 
    
    --color-bg: #1e293b;      
    --color-card-bg: #2d384b; 
    --color-text: #ffffff;    
    --color-subtle-text: #94a3b8;
    --color-border: #3b4d63;
}

/* Estilos de Reinicio y Transición */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* FIX CRÍTICO: Evita que el menú fijo cubra los títulos */
    scroll-padding-top: 100px; 
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.5s, color 0.5s; 
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}

h1, h2, h3, h4 {
    margin-bottom: 0.5em;
    font-weight: 600;
}

p {
    margin-bottom: 1em;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    margin-top: 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #154687; 
    transform: translateY(-2px);
}


/* =================================================================
   2. ESTILOS DE NAVEGACIÓN Y HEADER (HERO) - ORDEN PROFESIONAL
   ================================================================= */

/* Elimina el estilo fijo del botón Dark Mode anterior */
.theme-toggle-btn {
    display: none !important; 
}

/* Estilos de la barra de navegación */
.main-nav {
    background-color: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Contenedor principal de la navegación para escritorio */
.main-nav .container {
    display: flex; 
    justify-content: space-between;
    align-items: center;
    padding-right: 0; 
}

.nav-menu {
    display: flex;
    list-style: none;
    justify-content: flex-end;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-text);
    padding: 8px 15px;
    transition: color 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--color-primary);
}

.nav-toggle {
    display: none;
    cursor: pointer;
}

/* Estilos de los controles de utilidad (Idioma + Dark Mode) */
.utility-controls {
    display: flex;
    align-items: center;
    gap: 5px; /* Reducimos el gap para el separador EN|ES */
    margin-left: 20px; 
}

/* FIX CRÍTICO: Diseño Minimalista para el Botón Dark Mode */
.btn-theme-inline {
    background-color: transparent; /* Fondo transparente */
    padding: 0; /* Menos padding */
    border: none; /* Quitamos el borde */
    cursor: pointer;
    font-size: 1.2em; /* Más grande, para usar solo el ícono */
    font-weight: 600;
    transition: color 0.3s;
    margin-left: 0; 
    width: auto; /* Ancho automático para que ocupe solo el icono */
    text-align: center;
    
    /* FIX VISIBILIDAD: Usamos el color de texto primario en Light Mode */
    color: var(--color-primary); 
}

.btn-theme-inline:hover {
    background-color: transparent; 
    color: var(--color-secondary); /* Resaltado al pasar el ratón */
}

/* FIX ESTÉTICO: selector de idioma minimalista */
.utility-controls a {
    padding: 0; /* Quitamos el padding extra */
    font-weight: 600;
    font-size: 1em;
    text-decoration: none; /* Asegura que no haya subrayado */
    transition: color 0.3s;
}

/* NUEVO: Estilo para el separador vertical */
.utility-controls .lang-separator {
    color: var(--color-subtle-text);
    padding: 0 5px; 
    font-size: 1em;
    font-weight: 400; /* No debe ser tan grueso como el idioma */
}


/* HERO SECTION */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    text-align: left;
    background-color: var(--color-bg);
    padding-top: 80px;
}

.hero h1 {
    font-size: 3.5em;
    color: var(--color-primary); 
}

.hero h2 {
    font-size: 1.8em;
    color: var(--color-secondary); 
}

.greeting {
    font-size: 1.2em;
    margin-bottom: -5px;
    color: var(--color-subtle-text);
}


/* =================================================================
   3. SECCIONES DE CONTENIDO (ABOUT & SKILLS)
   ================================================================= */
.about-me {
    background-color: var(--color-card-bg);
    padding: 60px 0;
    border-top: 1px solid var(--color-border);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skill-card {
    background-color: var(--color-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--color-secondary); 
    transition: background-color 0.3s;
}

.skill-card h4 {
    color: var(--color-primary);
    margin-top: 0;
}

/* =================================================================
   4. SECCIÓN DE PROYECTOS (CRÍTICA)
   ================================================================= */
.projects {
    padding: 60px 0;
    text-align: center;
}

.projects h3 {
    text-align: left;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    text-align: left;
    background-color: var(--color-card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--color-border);
    
    /* 💥 FIX PROFESIONAL: FUERZA LA ALINEACIÓN VERTICAL (Flexbox) 💥 */
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; /* Empuja el botón al fondo de la tarjeta */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-card h4 {
    color: var(--color-primary);
    font-size: 1.5em;
    margin-bottom: 5px;
}

.project-card .tech-stack {
    color: var(--color-secondary); 
    font-size: 0.9em;
    margin-bottom: 15px;
}

.btn-project {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    background-color: var(--color-secondary);
    color: white;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.btn-project:hover {
    background-color: #e56d0d;
}

/* =================================================================
   5. SECCIÓN DE CONTACTO
   ================================================================= */
.contact {
    padding: 60px 0;
    text-align: center;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}


/* FOOTER Y REDES SOCIALES */

footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--color-border);
    font-size: 0.9em;
    background-color: var(--color-card-bg);
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.social-links {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.social-icon {
    font-size: 1.8em; 
    transition: color 0.3s, transform 0.3s;
    color: var(--color-subtle-text); 
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.1); 
}

.social-icon.github:hover {
    color: var(--color-text); 
}

.social-icon.linkedin:hover {
    color: #0077B5; 
}


/* =================================================================
   6. MEDIA QUERIES (RESPONSIVE)
   ================================================================= */
@media (max-width: 768px) {
    
    .hero {
        min-height: 50vh;
        text-align: center;
        padding-top: 60px;
    }

    .hero h1 {
        font-size: 2.5em;
    }

    .hero h2 {
        font-size: 1.5em;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Estilizado y Posición del Menú Hamburguesa */
    .nav-toggle {
        display: block;
        cursor: pointer;
        background: none;
        border: 1px solid var(--color-border);
        padding: 5px 10px;
        border-radius: 5px;
        color: var(--color-text);
        font-size: 1.2em;
        position: absolute;
        right: 20px; 
        top: 15px;
        z-index: 100;
        transition: color 0.3s, background-color 0.3s;
    }

    .main-nav .container {
        padding-right: 0; 
    }
    
    /* El menú pasa a ser columna */
    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        position: absolute;
        top: 55px; 
        left: 0;
        background-color: var(--color-card-bg);
        transition: max-height 0.3s ease-in-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu-active {
        max-height: 400px; 
    }
    
    /* Aseguramos que cada elemento de lista ocupe todo el ancho */
    .nav-menu li {
        width: 100%; 
    }

    /* FIX ELEGANCIA: Mejor espaciado y solo un borde inferior */
    .nav-menu a {
        padding: 15px 20px;
        border-top: none; 
        border-bottom: 1px solid var(--color-border); 
        width: 100%;
        display: block; 
        text-align: left;
    }
    
    /* Controles de utilidad en móvil */
    .utility-controls {
        flex-direction: row; 
        justify-content: flex-start;
        align-items: center;
        gap: 5px; /* FIX: Reducimos el gap para el separador EN|ES */
        width: 100%;
        padding: 15px 20px;
        border-top: none; 
        border-bottom: 1px solid var(--color-border); 
        margin-left: 0;
    }

    /* Ajuste para el selector de idioma dentro de los controles */
    .utility-controls > a {
        margin-bottom: 0; 
        padding: 0; 
        display: inline;
        font-size: 1em; 
    }
    
    .btn-theme-inline {
        margin-top: 0; 
        width: auto; 
        text-align: center;
        font-size: 1.2em;
        padding: 0; 
    }

    /* Ocultamos el botón fijo anterior */
    .theme-toggle-btn {
        display: none;
    }
}