/* style.css (Premium Redesign) */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --pearl: #FDFBF7;
    --sand-cream: #F4EBE1;
    --gold-leaf: #C89F53;
    --gold-glow: rgba(200, 159, 83, 0.4);
    --desert-night: #1A202C;
    --text-primary: #2D3748;
    --text-soft: #718096;
    --white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--pearl);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    color: var(--desert-night);
    font-weight: 600;
}

/* Glassmorphism Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 25px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.5s ease;
    background: transparent;
}

header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 5%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

header .logo, header .btn-volver {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 2px;
    transition: color 0.5s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header .logo { font-size: 1.6rem; }
header .btn-volver { font-size: 0.85rem; display: flex; align-items: center; }
header .btn-volver i { margin-right: 8px; }

header.scrolled .logo, header.scrolled .btn-volver {
    color: var(--desert-night); /* Azul noche oscuro para altísimo contraste sobre cristal blanco */
    text-shadow: none;
}

header.scrolled .logo:hover, header.scrolled .btn-volver:hover {
    color: var(--gold-leaf);
}

/* Hero Section Premium */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1504052434569-70ad5836ab65?auto=format&fit=crop&w=1950&q=80') center/cover;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 0.5s ease-out;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(26,32,44,0.4) 0%, rgba(26,32,44,0.8) 100%);
    z-index: 2;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 4;
    padding: 0 20px;
    max-width: 900px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}

.hero h1 {
    color: var(--pearl);
    font-size: 5rem;
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.8rem;
    color: var(--gold-leaf);
    margin-bottom: 40px;
}

/* Invitación al scroll */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    color: var(--white);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
    animation: bounce 2s infinite ease-in-out;
}

.scroll-indicator::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--white), transparent);
    margin-top: 10px;
}

/* Audio Player Flotante */
.ambient-audio-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    color: var(--gold-leaf);
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ambient-audio-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--white);
    box-shadow: 0 15px 35px var(--gold-glow);
}

.ambient-audio-btn .waves {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--gold-leaf);
    opacity: 0;
}

.ambient-audio-btn.playing .waves {
    animation: ripple 2s infinite;
}

/* Series Section */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
    position: relative;
    z-index: 10;
}

.intro-text {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 80px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--text-soft);
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--desert-night);
}

.section-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
}

.gold-separator {
    width: 40px;
    height: 2px;
    background-color: var(--gold-leaf);
    position: relative;
}

.gold-separator::before, .gold-separator::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--gold-leaf);
    border-radius: 50%;
    top: -2px;
}
.gold-separator::before { left: -10px; }
.gold-separator::after { right: -10px; }

/* Grid de Series ultra-premium */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 50px;
}

.serie-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.04);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(0);
}

.serie-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(200,159,83,0.3) 0%, transparent 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.serie-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 60px rgba(28,32,44,0.08);
}

.serie-card:hover::before {
    opacity: 1;
}

.serie-img-wrapper {
    height: 300px;
    overflow: hidden;
    position: relative;
    background: var(--sand-cream);
}

.serie-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.serie-card:hover .serie-img {
    transform: scale(1.08);
}

.serie-content {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: linear-gradient(to top, var(--white) 80%, transparent 100%);
    position: relative;
    margin-top: -30px; /* Sobreponer sobre la imagen */
    border-radius: 20px 20px 0 0;
}

.serie-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.serie-card:hover .serie-content h3 {
    color: var(--gold-leaf);
}

.serie-content p {
    color: var(--text-soft);
    font-size: 0.95rem;
    margin-bottom: 30px;
    
    /* Limitar a 4 líneas máximo (Truncamiento moderno) */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 12px 0;
    color: var(--desert-night);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
    margin-top: auto; /* Empuja el botón siempre al fondo de la tarjeta */
}

.btn-premium i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.serie-card:hover .btn-premium i {
    transform: translateX(5px);
    color: var(--gold-leaf);
}

.btn-premium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--gold-leaf);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.serie-card:hover .btn-premium::after {
    width: 100%;
}


/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Intersection Observer Classes */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Footer */
footer {
    background-color: var(--desert-night);
    color: var(--white);
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
}

footer .footer-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--gold-leaf);
    margin-bottom: 20px;
}

footer p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

footer .admin-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-block;
    margin-top: 10px;
    transition: color 0.3s;
}

footer .admin-link:hover {
    color: var(--gold-leaf);
}

/* =========================================
   Responsive: Experiencia Mobile iOS App-like
   ========================================= */
@media (max-width: 768px) {
    /* Bug fix para 100vh en Safari iOS */
    .hero {
        height: 100dvh; 
    }
    
    .hero h1 { 
        font-size: 3rem; 
        line-height: 1.1;
    }
    
    .hero-subtitle { 
        font-size: 1.4rem; 
        margin-bottom: 20px;
    }
    
    .section-title { 
        font-size: 2.2rem; 
    }
    
    /* Ocultar el header original y el botón de audio viejo en móvil */
    #main-header, .ambient-audio-btn:not(.app-nav-audio) {
        display: none !important;
    }

    /* Diseño del Bottom Nav (App Dock) */
    .app-bottom-nav {
        position: fixed;
        bottom: 20px;
        left: 5%;
        right: 5%;
        width: 90%;
        background: var(--glass-bg);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid var(--glass-border);
        border-radius: 40px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 10px 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
        z-index: 1000;
    }

    .app-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-soft);
        font-size: 0.75rem;
        gap: 5px;
        transition: color 0.3s;
    }

    .app-bottom-nav .nav-item i {
        font-size: 1.2rem;
        color: var(--desert-night);
    }

    .app-bottom-nav .nav-item:hover, .app-bottom-nav .nav-item:active {
        color: var(--gold-leaf);
    }
    
    .app-bottom-nav .nav-item:hover i {
        color: var(--gold-leaf);
    }

    /* Botón Flotante Central (Música) */
    .nav-item-center {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 60px;
    }

    .app-nav-audio {
        position: absolute;
        bottom: -15px; /* Sobresale hacia arriba */
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--gold-leaf) 0%, var(--gold-glow) 100%);
        color: var(--white);
        border: 4px solid var(--pearl);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        box-shadow: 0 10px 25px rgba(200, 159, 83, 0.4);
        cursor: pointer;
        z-index: 1001;
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .app-nav-audio:active {
        transform: scale(0.9);
    }

    .app-nav-audio .waves {
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 2px solid var(--gold-leaf);
        opacity: 0;
    }

    .app-nav-audio.playing .waves {
        animation: ripple 2s infinite;
    }

    /* Ocultar scroll indicator nativo porque estorba al dock */
    .scroll-indicator {
        bottom: 120px;
    }

    /* Tarjetas de Series estilo iOS Widget (Apple Music Cards) */
    .container {
        padding: 60px 15px;
    }
    
    .series-grid { 
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 30px; 
        margin: 0 -15px; /* Romper márgenes para swipe edge-to-edge */
        padding-left: 15px;
        padding-right: 15px;
        -webkit-overflow-scrolling: touch;
    }

    .series-grid::-webkit-scrollbar {
        display: none; /* App Like (no barras feas) */
    }
    
    .serie-card {
        flex: 0 0 85vw; /* 85% del ancho de la pantalla */
        scroll-snap-align: center;
        border-radius: 28px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.06);
        margin: 0; 
    }
    
    .serie-img-wrapper {
        height: 380px; /* Más alto, formato retrato */
    }
    
    .serie-content {
        padding: 30px 25px;
        border-radius: 28px 28px 0 0;
        background: var(--white); /* Fondo sólido en móvil para leer mejor */
        margin-top: -40px;
    }
    
    .serie-content h3 {
        font-size: 2rem; /* iOS Large Title en la Card */
        line-height: 1.1;
    }
    
    /* Ajuste de Footer */
    footer {
        padding-bottom: 100px; /* Dejar espacio para el dock inferior */
    }
}
