/* 
   Theme: Antigravity - Deep Purple & Lavender
   Author: Antigravity Agent
*/

:root {
    --primary-color: #4A148C;
    --secondary-color: #7B1FA2;
    --accent-color: #D4AF37;
    --bg-light: #F3E5F5;
    --bg-white: #FFFFFF;
    --text-dark: #2E1A47;
    --text-light: #6A1B9A;
    --text-white: #FFFFFF;
    --shadow-soft: 0 10px 30px rgba(74, 20, 140, 0.1);
    --shadow-hover: 0 20px 40px rgba(74, 20, 140, 0.2);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --transition-speed: 0.4s;
}

/* --- Base & Resets --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body { 
    font-family: var(--font-body); 
    color: var(--text-dark); 
    background-color: var(--bg-white); 
    line-height: 1.6; 
    overflow-x: hidden;
    max-width: 100%;
    background-image: url('/assets/img/ui/orchid-bg-1.png') !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center !important;
}
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--primary-color); }
a { text-decoration: none; color: inherit; transition: var(--transition-speed); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* --- Utility Classes --- */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* --- Navigation --- */
.main-header {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 1000; box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 10px 0; transition: all 0.3s ease;
}

.main-header .container {
    position: relative;
    min-height: 80px;
    max-width: 1400px;
}

#inicio {
    padding-top: 12rem !important; /* Visual padding for Hero top */
}

/* --- Mobile Drawer (Synced to 1280px) --- */
@media (max-width: 1280px) {
    .hamburger { display: block !important; cursor: pointer; font-size: 1.5rem; color: var(--primary-color); z-index: 1010; transition: transform 0.3s ease; }
    .nav-links {
        display: none; position: fixed; top: 0; right: -100%;
        width: 85%; max-width: 350px; height: auto;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: flex-start; padding: 70px 40px 40px;
        z-index: 1005; transition: right 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: -15px 0 40px rgba(74, 20, 140, 0.15);
        border-left: 1px solid rgba(255, 255, 255, 0.3);
    }
    .nav-links.active { 
        display: flex !important; 
        right: 0 !important; 
    }
    .nav-links li { 
        width: 100%; margin-bottom: 1.5rem; 
        border-bottom: 1px solid rgba(74, 20, 140, 0.05);
        padding-bottom: 0.5rem;
    }
    .nav-links a { font-size: 1.1rem; font-weight: 700; color: var(--primary-color); display: block; }
}

@media (min-width: 1281px) {
    .hamburger { display: none !important; }
    .nav-links { display: flex; gap: 1.5rem; align-items: center; }
}

/* --- Orchid Theme Fixes --- */
.bg-premium-orchid {
    background-image: linear-gradient(rgba(243, 225, 245, 0.3), rgba(255, 255, 255, 0.4)), url('/assets/img/ui/orchid-bg-1.png') !important;
    background-size: cover !important; background-position: center !important; background-attachment: fixed !important;
}

section.bg-white, #sobre-mi, #contacto > div {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

/* --- Hero Section --- */
.hero-glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem 1.75rem; border-radius: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

/* --- Bottom Nav & Floating Buttons --- */
#mobile-bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; width: 100%; height: 75px;
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0; border-top: 1px solid rgba(0,0,0,0.05); z-index: 2000;
}

#mobile-bottom-nav .nav-container {
    display: flex;
    height: 100%;
    width: 100%;
}

#mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

@media (max-width: 1280px) {
    #mobile-bottom-nav { 
        display: block !important; 
    }
}

.sticky-bot {
    position: fixed; bottom: 30px; right: 30px; z-index: 1500;
    display: flex; flex-direction: column; gap: 15px; align-items: flex-end;
}

@media (max-width: 1280px) {
    .sticky-bot { bottom: 125px !important; }
    #sticky-actions { bottom: 200px !important; }
}

/* === Navbar Mobile Compact === */
@media (max-width: 767px) {
    .main-header {
        padding: 2px 0 !important;
    }
    .main-header .container {
        min-height: 48px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* === Hero Mobile Redesign === */
@media (max-width: 767px) {
    #inicio {
        padding: 0 !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        min-height: 100svh;
    }
    /* Flex column para que el negative margin funcione */
    #hero-content-container {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        min-height: auto !important;
        gap: 0 !important;
    }
    /* Imagen va primero y ocupa la parte superior */
    .hero-image {
        order: -1;
        animation: none !important;
        transform: none !important;
        width: 100%;
    }
    .hero-image > div {
        border-radius: 0 !important;
        max-width: 100% !important;
        box-shadow: none !important;
        height: calc(60vh + 52px);
        overflow: hidden;
        position: relative;
    }
    /* Degradado inferior para suavizar la transición a la card */
    .hero-image > div::after {
        content: '';
        position: absolute;
        bottom: 0; left: 0; right: 0;
        height: 45%;
        background: linear-gradient(to bottom, transparent 0%, rgba(243, 229, 245, 0.55) 60%, rgba(255,255,255,0.92) 100%);
        pointer-events: none;
        z-index: 1;
    }
    .hero-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 28% !important;
        filter: blur(0.6px) brightness(1.04) !important;
    }
    /* Card superpuesta sobre la base de la imagen */
    .hero-glass-card {
        order: 1;
        border-radius: 1.5rem !important;
        margin-top: -15rem !important;
        margin-left: 15px !important;
        margin-right: 15px !important;
        padding: 1.25rem 1.25rem 6rem !important;
        background: rgba(255, 255, 255, 0.72) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        position: relative;
        z-index: 10;
        width: auto !important;
    }
    .hero-glass-card #hero-title {
        font-size: 0.54rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.2rem !important;
    }
    .hero-glass-card #hero-subtitle {
        font-size: 0.4rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* --- Comparison Slider --- */
.img-comp-container {
    position: relative; 
    height: 400px; 
    overflow: hidden;
    border-radius: 2rem; 
    cursor: col-resize; 
    width: 100%;
    background: #f8f9fa;
}
/* Both divs start full width, overlay is clipped by JS using clip-path */
/* 
   IMPORTANTE: Usamos clip-path en lugar de width para el overlay.
   Esto evita que el navegador redimensione/escale la imagen al mover el slider,
   garantizando que las facciones (ojos, nariz, boca) coincidan perfectamente 
   entre el 'antes' y el 'después' sin deformaciones.
*/
.img-comp-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: inset(0 50% 0 0); /* Inicio en el centro exacto */
    transition: none;
    z-index: 2; /* Asegura que la capa de recorte esté sobre la imagen de fondo */
}
.img-comp-img { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
}
.img-comp-img img { 
    display: block; 
    height: 100%; 
    width: 100%; 
    object-fit: cover; 
    position: absolute;
    top: 0;
    left: 0;
}

/* Antes/Después Labels */
.comp-label {
    position: absolute;
    top: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    z-index: 5;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.comp-label.before { left: 1.5rem; }
.comp-label.after { right: 1.5rem; }

.img-comp-slider {
    position: absolute; 
    z-index: 10; 
    cursor: ew-resize;
    width: 36px; 
    height: 36px; 
    background: white; 
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0,0,0,0.25); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: var(--primary-color);
    border: 2px solid white;
    transition: transform 0.2s;
}
.img-comp-slider:hover { transform: translate(-50%, -50%) scale(1.1); }
.img-comp-slider::before { 
    content: '\f337'; 
    font-family: "Font Awesome 6 Free"; 
    font-weight: 900; 
    font-size: 14px;
}
.img-comp-slider::before { content: '\f337'; font-family: "Font Awesome 6 Free"; font-weight: 900; }

/* --- Bio Toggle --- */
.line-clamp-6 { display: -webkit-box; -webkit-line-clamp: 6; line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.expanded.line-clamp-6 { -webkit-line-clamp: unset; line-clamp: unset; }

/* Heartbeat & Float Animations Pre-defined in index.html or here */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.animate-heartbeat { animation: heartbeat 2s ease-in-out infinite; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .container { padding-left: 15px; padding-right: 15px; }
    .hero-glass-card { width: 95%; margin: 0 auto; }
}

/* --- Bot Visibility Fix --- */
/* Bot visibility states */
.bot-hidden {
    display: none !important;
}

/* Hide bot bubble when chat is open on mobile */
@media (max-width: 1279px) {
    body.chat-open #bot-toggle-btn {
        display: none !important;
    }
}
