/* Base Styles & Variables: Clean Corporate Palette */
:root {
    --primary-color: #1EC8BB;
    --primary-dark: #17a99f;
    --primary-pastel: rgba(30, 200, 187, 0.12);
    --text-dark: #1a202c;
    --text-light: #4a5568;
    --bg-white: #FFFFFF;
    --bg-alt: #F4F9F9;
    --border-light: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ******************************************
   NAVIGATION MENU & PROGRESS BAR
   ****************************************** */
header {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background-color: transparent;
}

.logo-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.2px;
}

.nav-links {
    list-style: none;
    gap: 2.5rem;
}

/* --- Control dinámico de Menús según la página --- */
.nav-index, .nav-legal {
    display: none; /* Ocultamos ambos inicialmente */
}

body.page-index .nav-index {
    display: flex;
}

body.page-legal .nav-legal {
    display: flex;
}

.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s, transform 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-dark);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Reading Progress Bar --- */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: transparent;
    position: absolute;
    bottom: 0;
    left: 0;
}

.progress-bar {
    height: 4px;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Global Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 10px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(30, 200, 187, 0.2);
}

.btn:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(30, 200, 187, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(30, 200, 187, 0.3);
}

/* Section Structure */
section {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    width: 100%;
}

h1 {
    font-size: 3.8rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.1;
    letter-spacing: -1px;
    font-weight: 800;
}

h2 {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    text-align: center;
    font-weight: 700;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Home Section */
#home {
    padding-top: 180px;
    padding-bottom: 80px;
    background-color: var(--bg-white);
}

.hero-text {
    color: var(--text-light);
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* About Me Section */
#about {
    padding-top: 80px;
    padding-bottom: 80px;
    background-color: var(--bg-alt);
    box-shadow: inset 0px 8px 15px -8px rgba(0,0,0,0.05), inset 0px -8px 15px -8px rgba(0,0,0,0.05);
}

.about-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(30, 200, 187, 0.08);
    padding: 50px;
    display: flex;
    gap: 50px;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.profile-photo {
    width: 280px;
    height: 300px;
    background: #e2e8f0;
    border-radius: 16px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-text {
    flex: 1;
}

.about-text p:first-child {
    margin-top: -5px;
}

.social-networks {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.social-icon {
    width: 45px;
    height: 45px;
    background-color: var(--primary-pastel);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon svg {
    width: 22px;
    height: 22px;
    transition: all 0.3s;
    stroke: currentColor;
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(30, 200, 187, 0.3);
}

/* Contact Section */
#contact {
    padding-top: 80px;
    padding-bottom: 90px;
    background-color: var(--bg-white);
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    text-align: left;
    padding: 40px;
    background-color: var(--bg-white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.contact-form input:not([type="checkbox"]), .contact-form textarea, .contact-form select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #f8fafc;
    color: var(--text-dark);
    font-family: inherit;
    box-sizing: border-box;
}

.contact-form input:not([type="checkbox"]):focus, .contact-form textarea:focus, .contact-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(30, 200, 187, 0.15);
}

/* ========================================================
   LEGAL PAGE STYLES (legal.html)
   ======================================================== */
#legal-section { 
    padding-top: 140px; 
    padding-bottom: 80px; 
}

/* Contenedor para colocar título a la izquierda y fecha a la derecha */
.legal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    gap: 15px;
    margin-bottom: 30px;
}

.legal-header h1 {
    margin-bottom: 0;
}

.legal-update { 
    display: inline-block; 
    font-size: 0.85rem; 
    background-color: var(--primary-pastel); 
    color: var(--primary-dark); 
    padding: 5px 15px; 
    border-radius: 12px; 
    font-weight: 600;
}

.legal-block { 
    background-color: var(--bg-white); 
    border-radius: 16px; 
    padding: 40px; 
    margin-bottom: 40px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); 
    border: 1px solid var(--border-light); 
}

.legal-block h3 { 
    font-size: 1.8rem; 
    color: var(--primary-dark); 
    margin-bottom: 25px; 
    padding-bottom: 15px; 
    border-bottom: 2px solid var(--primary-pastel); 
}

.legal-block h4 { 
    font-size: 1.3rem; 
    color: var(--text-dark); 
    margin-top: 30px; 
    margin-bottom: 15px; 
}

.legal-block p, 
.legal-block ul { 
    color: var(--text-light); 
    line-height: 1.8; 
    margin-bottom: 15px; 
}

.legal-block ul { 
    padding-left: 25px; 
}

.legal-block a { 
    color: var(--primary-color); 
    font-weight: 600; 
    text-decoration: none; 
}

.legal-block a:hover { 
    text-decoration: underline; 
    color: var(--primary-dark); 
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 1.5rem 5%;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    font-size: 0.95rem;
}

.footer-left a {
    color: #ffffff;
    text-decoration: underline;
    transition: opacity 0.3s;
    align-self: flex-start;
    cursor: pointer;
}

.footer-left a:hover {
    opacity: 0.8;
}

.footer-socials {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-social-icon {
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.footer-social-icon:hover {
    transform: translateY(-3px);
    opacity: 0.9;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.footer-social-icon svg {
    width: 18px;
    height: 18px;
}

.icon-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Responsive Consent Banner */
.consent-panel {
    position: fixed;
    bottom: 25px;
    left: 25px;
    max-width: 380px;
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    padding: 25px;
    z-index: 1500;
    border: 1px solid var(--border-light);
    display: none; 
    flex-direction: column;
    gap: 15px;
}

.consent-panel.show {
    display: flex; 
    animation: slideUpFade 0.5s ease-out forwards;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

.consent-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.consent-panel-text {
    font-size: .9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.consent-buttons { 
    display: flex; 
    gap: 10px; 
    margin-top: 5px; 
}

.consent-buttons .btn { 
    flex: 1; 
    padding: 10px 0; 
    font-size: 0.9rem; 
    text-align: center; 
}

/* ========================================================
   MODIFICACIÓN DEL FOOTER SOLO PARA LA PÁGINA LEGAL
   ======================================================== */
body.page-legal .footer-content {
    flex-direction: column;
    align-items: flex-start; /* Alinea todo el bloque a la izquierda */
    gap: 15px;
}

body.page-legal .footer-left a {
    display: none; /* Ocultamos el enlace "Legal Information" */
}

body.page-legal .footer-socials {
    justify-content: flex-start; /* Aseguramos que la fila de iconos inicie a la izquierda */
}

/* ========================================================
   BOTÓN FLOTANTE "VOLVER A HOME" (Animado por JS)
   ======================================================== */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 0;          /* Oculto por defecto (El JS añade la clase .show) */
    visibility: hidden;
    transform: translateY(20px); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-floating:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px); 
    box-shadow: 0 6px 20px rgba(30, 200, 187, 0.3);
}

.btn-floating.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); 
}

/* Media Queries */
@media (max-width: 850px) {
    .about-card { flex-direction: column; padding: 30px; text-align: center; align-items: center; }
    .profile-photo { width: 100%; max-width: 300px; height: 300px; margin: 0 auto; }
    .social-networks { justify-content: center; }
    .about-text p:first-child { margin-top: 0; }
}

@media (max-width: 768px) {
    nav { flex-direction: column; gap: 1rem; }
    .nav-links { gap: 1.5rem; }
    .nav-links a::after { display: none; }
    
    /* Centramos el footer en móviles, independientemente de en qué página estemos */
    .footer-content, body.page-legal .footer-content { 
        flex-direction: column; 
        text-align: center; 
        justify-content: center; 
        align-items: center; 
    }
    
    .footer-left { text-align: center; align-items: center; }
    .footer-left a { align-self: center; }
    
    .footer-socials, body.page-legal .footer-socials { 
        justify-content: center; 
        margin-top: 10px; 
    }
    
    #home { padding-top: 160px; }
    h1 { font-size: 2.8rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-row > .form-group { margin-bottom: 20px; }
    
    .consent-panel { 
        bottom: 0; 
        left: 0; 
        border-radius: 16px 16px 0 0; 
        max-width: 100%; 
        width: 100%; 
        border-left: none; 
        border-right: none; 
        border-bottom: none; 
    }
    
    /* Evita que el botón flotante se solape con el menú inferior en móviles */
    .btn-floating {
        bottom: 80px; 
        right: 20px;
    }
}