/* ------------ Splash Screen (Netflix Style) ------------ */
#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse 150% 100% at 50% 50%, #0f0f1e 0%, #000 60%);
    z-index: 2147483647;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    animation: fadeOutSplash 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 3.8s forwards;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#splashContainer {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#splashLogo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1200px;
    z-index: 10;
}

#splashLogo .splash-text {
    font-size: clamp(4rem, 12vw, 6rem);
    font-family: var(--font-viata);
    font-weight: 900;
    letter-spacing: -3px;
    background: linear-gradient(90deg, #762BDE, #3B76C3, #00C1A7, #2669F5, #762BDE);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px rgba(118, 43, 222, 0.4));
    animation:
        splashReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        splashShimmer 3s linear forwards;
    text-transform: lowercase;
}

#splashLogo .splash-text .play {
    font-weight: 300;
    margin-left: 3px;
    letter-spacing: 2px;
}

/* Netflix-style splash keyframes */
@keyframes splashReveal {
    0% {
        transform: scale(0.5) translateZ(-200px);
        opacity: 0;
        filter: blur(40px);
    }

    50% {
        filter: blur(0);
    }

    100% {
        transform: scale(1) translateZ(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes splashShimmer {
    0% {
        background-position: -200% center;
        filter: brightness(1) saturate(1);
    }
    50% {
        background-position: 200% center;
        filter: brightness(1) saturate(1);
    }
    70% {
        filter: brightness(1) saturate(1);
    }
    100% {
        background-position: 200% center;
        filter: brightness(2.2) saturate(0);
    }
}

@keyframes shineEffect {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes accentLineSlide {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes fadeOutSplash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}



/* ------------ Navbar (Adapted MSTPlay Official) ------------ */
#navbar-container {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 18, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: env(safe-area-inset-top) 4% 0;
    height: calc(72px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transition: background 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#navbar-container.scrolled {
    background: rgba(6, 6, 12, 0.88);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-brand {
    font-family: var(--font-viata);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    margin-right: 10px;
    text-decoration: none;
    transition: all 0.35s ease;
}

.nav-brand .play {
    color: #fff;
    font-weight: 400;
    transition: all 0.35s ease;
}

.nav-brand:hover,
.nav-brand:active {
    background: linear-gradient(90deg, #762BDE, #3B76C3, #00C1A7, #2669F5, #762BDE);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerGradient 2s linear infinite;
}

.nav-brand:hover .play,
.nav-brand:active .play {
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-viata);
    padding: 6px 12px;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    font-weight: 700;
}

/* Dropdown Explore */
.nav-dropdown {
    position: relative;
    font-family: var(--font-viata);
}

.dropdown-trg i {
    font-size: 0.7rem;
    margin-left: 5px;
}

.dropdown-content {
    position: absolute;
    top: 48px;
    left: 0;
    background: rgba(14, 14, 24, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    min-width: 230px;
    border-radius: 14px;
    display: none;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    font-family: var(--font-viata);
    animation: dropdownFadeIn 0.25s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown:hover .dropdown-content {
    display: flex;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.filter-group select {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    font-size: 0.88rem;
    outline: none;
    font-family: var(--font-viata);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.filter-group select:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

/* Nav Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #fff;
}

.search-bar {
    display: flex;
    align-items: center;
    position: relative;
}

.search-bar i {
    font-size: 1.1rem;
    color: #fff;
    cursor: pointer;
}

.search-bar input {
    width: 0;
    background: rgba(10, 10, 18, 0.85);
    border: 1px solid transparent;
    color: #fff;
    padding: 5px 0;
    margin-left: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    font-size: 0.9rem;
    opacity: 0;
    font-family: var(--font-viata);
}

.search-bar.active input {
    width: 260px;
    padding: 10px 18px;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    opacity: 1;
}

.nav-web-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-viata);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-web-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.nav-web-btn:active {
    transform: translateY(0);
}

.nav-login-btn {
    background: #fff;
    color: #000;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
    font-family: var(--font-viata);
}

.nav-login-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
    color: #000;
}

.nav-help-btn,
.nav-music-btn {
    text-decoration: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 1.12rem;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-help-btn:hover,
.nav-music-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* Language Selector — clean text link */
.lang-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-viata, 'Outfit', sans-serif);
    cursor: pointer;
    margin-right: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    user-select: none;
}

.lang-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.user-profile {
    position: relative;
    cursor: pointer;
    font-family: var(--font-viata);
}

.avatar {
    width: 38px;
    height: 38px;
    background: #181824;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.user-profile .user-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background: rgba(14, 14, 24, 0.95);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 200px;
    display: none;
    flex-direction: column;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    transform-origin: top right;
    animation: dropdownPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
}

@keyframes dropdownPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.user-profile.active .user-dropdown {
    display: flex;
}

.dropdown-header-info {
    padding: 6px 10px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
    margin-top: 6px;
}

.user-dropdown a {
    color: rgba(255, 255, 255, 0.75);
    padding: 7px 10px;
    font-size: 0.86rem;
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    text-transform: none;
}

.user-dropdown a i {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.72;
    color: #fff;
    transition: all 0.2s;
}

.user-dropdown a .mediamusic-logo-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    opacity: 0.72;
    background-color: #fff;
    transition: all 0.2s;
    -webkit-mask: url('../imagenes/mediamusicmarcadeagua.svg') no-repeat center / contain;
    mask: url('../imagenes/mediamusicmarcadeagua.svg') no-repeat center / contain;
}

.user-dropdown a:hover .mediamusic-logo-icon {
    opacity: 1;
    background-color: var(--primary-color);
}

.user-dropdown a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Vertical gradient strip on hover */
.user-dropdown a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    background: var(--grad-mst-vibrant);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s ease;
}

.user-dropdown a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.user-dropdown a:hover i {
    opacity: 1;
    color: var(--primary-color);
    background: none;
    transform: scale(1.05);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 6px -4px;
}

.user-dropdown a.logout-link {
    color: #ef4444;
    justify-content: center;
    padding: 8px;
    font-weight: 700;
    font-size: 0.88rem;
}

.user-dropdown a.logout-link i {
    display: none;
}

.user-dropdown a.logout-link:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff5c5c;
    text-decoration: none;
}

/* Profile Switcher in Dropdown */
.profile-switcher-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 10px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.profile-switch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    width: 68px;
    transition: all 0.2s ease;
}

.profile-switch-item:hover {
    background: none;
}

.profile-switch-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.profile-switch-item:hover .profile-switch-avatar {
    transform: scale(1.08);
    border-color: var(--primary-color);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.profile-switch-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    max-width: 68px;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    transition: color 0.2s;
    font-family: var(--font-body);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-switch-item:hover .profile-switch-name {
    color: #fff;
}

/* Change Profile Overlay */
.profile-switch-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.profile-switch-overlay.active {
    opacity: 1;
    visibility: visible;
}

.load-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: profilePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes profilePop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.profile-switch-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-web-btn {
        display: none;
    }
}

/* ------------ Main Content ------------ */
.main-container {
    padding-top: calc(72px + env(safe-area-inset-top));
    /* Space for fixed navbar */
}

/* ------------ In-Page Filters (RoPlay Style) ------------ */
#controlsSection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 4%;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
    background: transparent;
}

@media (min-width: 768px) {
    #controlsSection {
        flex-direction: row;
    }
}

.premium-filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

.filter-item {
    flex: 1;
    min-width: 160px;
    max-width: 300px;
}

.btn-catalog {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-family: var(--font-viata);
    transition: all 0.3s;
}

.btn-catalog:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#controlsSection {
    position: relative;
    z-index: 10;
    background: transparent;
    padding: 15px 4%;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .premium-filter-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        width: 100%;
    }

    .filter-item {
        grid-column: span 1;
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        height: 46px;
        margin: 0;
        box-sizing: border-box;
    }

    .search-box-wrapper {
        grid-column: span 2 !important;
        width: 100% !important;
        max-width: none !important;
        order: -1;
    }

    .btn-catalog {
        grid-column: span 2 !important;
        width: 100% !important;
        max-width: none !important;
        justify-content: center;
        text-align: center;
    }

    .filter-dropdown {
        font-size: 16px !important;
        padding: 0 15px !important;
        padding-right: 35px !important;
        /* Space for arrow */
        height: 46px !important;
        line-height: normal !important;
        box-sizing: border-box;
        margin: 0;
        display: block;
        color: white !important;
        background: rgba(255, 255, 255, 0.15) !important;
        /* Slightly more opaque */
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 30px;
    }

    /* Standardize select vertical centering */
    select.filter-dropdown {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #navSearch {
        padding-left: 45px !important;
    }

    .filter-item input[type="date"],
    .filter-item input[type="text"],
    .filter-item select {
        height: 46px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

.filter-box-wrapper,
.search-box-wrapper {
    position: relative;
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    /* Helper for non-select children if any */
}

.filter-dropdown {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    /* Glassy input */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 12px 40px 12px 20px;
    color: white;
    font-size: 0.95rem;
    appearance: none;
    /* Crucial for overriding native select arrow to show the custom one */
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

.filter-dropdown::placeholder {
    color: white;
    opacity: 1;
    /* Firefox fix */
}

.filter-dropdown:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* Ensure background is dark specifically for the <option> elements to see the white text */
.filter-dropdown option {
    background-color: #1a1a1a;
    color: white;
}

.filter-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 0.8rem;
    pointer-events: none;
}

/* Unified appearance for Date input */
input[type="date"].filter-dropdown,
input[type="text"].filter-dropdown#navDate {
    padding: 0 45px 0 20px !important;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    height: 46px;
    line-height: 46px;
    text-align: left;
    box-sizing: border-box;
}

input[type="date"].filter-dropdown::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
    margin-left: auto;
}

/* Date filter: mobile fix */
@media (max-width: 768px) {

    input[type="date"].filter-dropdown,
    input[type="text"].filter-dropdown#navDate {
        padding: 0 15px !important;
        height: 46px !important;
        line-height: 46px !important;
        text-align: center;
        font-size: 16px !important;
    }

    input[type="date"].filter-dropdown::-webkit-calendar-picker-indicator {
        position: static;
        margin-left: 8px;
    }
}

.nav-icon-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    padding: 8px;
    margin: -8px;
    /* Compensate for padding to maintain alignment */
}

/* ------------ Banner Carousel (Hero System Roplay Style) ------------ */
#bannerCarousel {
    position: relative;
    width: 100%;
    height: 90vh;
    min-height: 600px;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #000;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.banner-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.banner-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.banner-iframe-container {
    position: absolute;
    inset: -60px 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    overflow: hidden;
}

/* Top mask — hides YouTube top bar (title, share, etc.) */
.banner-iframe-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

/* Bottom mask — hides YouTube progress bar / controls */
.banner-iframe-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.banner-iframe-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(max(100vw, 177.77vh) * 1.6);
    height: calc(max(56.25vw, 100vh) * 1.6);
    transform: translate(-50%, -50%) scale(1.1);
    border: none;
    pointer-events: none;
}

.banner-gradient {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(0deg, var(--bg-color) 0%, rgba(0, 0, 0, 0.8) 30%, transparent 60%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, transparent 80%);
}

.banner-content {
    position: absolute;
    bottom: 25%;
    left: 4%;
    width: 60%;
    max-width: 800px;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
}

.banner-item.active .banner-content {
    animation: bannerContentFadeIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes bannerContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.hero-meta-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
}

/* Live badge — pulsing red dot */
.hero-meta-badge.live-badge {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ff6b6b;
    font-size: 11px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: liveGlow 2s ease-in-out infinite;
}

.hero-meta-badge.live-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

/* Upcoming/premiere badge */
.hero-meta-badge.upcoming-badge {
    background: rgba(118, 43, 222, 0.2);
    border-color: #762BDE;
    color: #a78bfa;
    font-size: 11px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-meta-badge.upcoming-badge i {
    font-size: 10px;
}

.hero-meta-badge.featured-badge {
    background: var(--primary-color);
    border: none;
    color: #fff;
    font-size: 11px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(118, 43, 222, 0.4);
    font-weight: 800;
}

/* Countdown timer under the badge */
.banner-countdown {
    font-family: var(--font-viata, 'Outfit', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.3);
    }
}

@keyframes liveGlow {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }
}

.banner-title {
    font-size: clamp(2.2rem, 4.5vw, 4rem);
    font-weight: 800;
    color: white;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
    font-family: var(--font-heading);
    /* Texto completo sin truncar como en RoPlay */
    overflow: visible;
}

.banner-desc {
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}

.banner-btns {
    display: flex;
    gap: 15px;
    align-items: center;
}

.banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 1.05rem;
    font-family: var(--font-heading);
    font-weight: 700;
    border-radius: 9999px;
    /* Highly rounded like RoPlay */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.banner-btn.primary {
    background: var(--grad-mst-vibrant);
    background-size: 200% auto;
    color: #fff;
    box-shadow: 0 8px 20px rgba(118, 43, 222, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-btn.primary:hover {
    background-position: right center;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(118, 43, 222, 0.4);
}

.banner-btn.primary:active {
    transform: translateY(0) scale(1);
}

.banner-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: none;
    /* Removed heavy generic blur */
}

.banner-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: scale(1.05);
}

#bannerIndicators {
    position: absolute;
    bottom: 40px;
    left: 4%;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dot.active {
    background: white;
    transform: scale(1.3);
}

/* ------------ Playlists ------------ */
.playlist-section {
    padding: 10px 0 30px;
}

.playlist-section h2 {
    font-family: var(--font-viata);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 15px;
    margin-left: 4%;
    padding-left: 15px;
    position: relative;
}

.playlist-section h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    background: var(--grad-mst-vibrant);
    border-radius: 4px;
}

.carousel-section-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.carousel-section {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 20px 4%;
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
    width: 100%;
}

.carousel-section::-webkit-scrollbar {
    display: none;
}

.catalog-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    justify-content: center;
    place-items: center;
    gap: 30px;
    padding: 40px 4%;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .catalog-grid-layout {
        grid-template-columns: repeat(2, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .catalog-grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
        gap: 20px;
    }
}

.video-card {
    min-width: 300px;
    width: 100%;
    flex-shrink: 0;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-smooth);
}

@media (max-width: 600px) {
    .video-card {
        min-width: 280px;
    }
}

/* Removed redundant .video-card:hover */

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.card-details {
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
}

.card-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    height: 2.6em;
    /* Ensures exactly 2 lines of space */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-viata);
    margin-bottom: 8px;
    white-space: normal;
}


.card-meta-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-age-rating {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: var(--font-viata);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-publish-date {
    font-size: 0.75rem;
    color: #fff;
    font-weight: 500;
    font-family: var(--font-viata);
}



@media (hover: hover) {
    .video-card:hover {
        transform: scale(1.03);
        z-index: 10;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-fast);
}

.rank-number {
    position: absolute;
    bottom: -15px;
    left: 5px;
    font-size: 8rem;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.8);
    line-height: 1;
    z-index: 5;
    font-family: var(--font-viata);
    pointer-events: none;
    letter-spacing: -2px;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.video-duration {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: white;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: var(--font-body);
}

.add-to-list-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) {
    .add-to-list-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.15);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .video-card:hover .add-to-list-btn {
        opacity: 1;
    }

    /* Adjust duration position slightly if we wanted them to co-exist, but they often replace each other. Let's move duration to bottom-right or keep duration visible on hover */
    .video-card:hover .video-duration {
        opacity: 0;
    }
}

@media (hover: none) {
    .add-to-list-btn {
        opacity: 1;
    }
}

.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #762BDE, #3B76C3, #00C1A7);
    width: 0%;
    transition: width 0.3s ease;
}

/* ------------ Carousel Arrows (Roplay Style) ------------ */
.carousel-arrow {
    position: absolute;
    top: 105px;
    /* Aligned vertically with the center of the 16:9 thumbnail cover */
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    outline: none;
}

.carousel-section-wrapper:hover .carousel-arrow {
    opacity: 1;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
    border-color: white;
}

.carousel-arrow.left {
    left: 1rem;
}

.carousel-arrow.right {
    right: 1rem;
}

.carousel-arrow i {
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.carousel-arrow:active i {
    transform: scale(0.9);
}

/* ------------ Promos (Universal Premium Photoless Style) ------------ */
.promo-row {
    padding: 40px 4%;
}

.promo-wrap {
    display: flex;
    position: relative;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --promo-color: #762BDE; /* Default fallback */
}

/* Immersive Background Continuity */
.promo-wrap::before {
    content: "";
    position: absolute;
    inset: -20px;
    background-image: var(--promo-img);
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.4) saturate(1.2);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

/* Dynamic Primary Color Glow at the Right End */
.promo-wrap::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, var(--promo-color) 0%, transparent 70%);
    opacity: 0.2;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (hover: hover) {
    .promo-wrap:hover {
        transform: translateY(-5px);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(118, 43, 222, 0.15);
        border-color: rgba(255, 255, 255, 0.25);
    }
    .promo-wrap:hover::before {
        opacity: 0.8;
        transform: scale(1.05);
        filter: blur(40px) brightness(0.5);
    }
    .promo-wrap:hover::after {
        opacity: 0.35;
        transform: scale(1.1) translateX(-10%);
    }
}

.promo-thumb {
    position: relative;
    z-index: 1;
    width: 45%;
    height: 380px;
    object-fit: cover;
    /* Mask for continuity */
    mask-image: linear-gradient(to right, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
}

.promo-copy {
    position: relative;
    z-index: 1;
    padding: 50px 60px;
    width: 100%; /* Copy takes full width because thumb is absolute/floated conceptually with mask */
    margin-left: -5%; /* Pull text slightly over the masked image for better blending */
    text-align: left;
}

@media (max-width: 900px) {
    .promo-wrap {
        flex-direction: column;
    }
    .promo-thumb {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .promo-copy {
        width: 100%;
        padding: 30px;
    }
}

.promo-title {
    font-family: var(--font-viata);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 15px;
    color: #fff;
}

.promo-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 35px;
    line-height: 1.6;
    max-width: 800px;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: #fff;
    color: #000 !important;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.2);
}

/* --- Special Audio Promo Theme (MediaMusic Audio Style) --- */
.audio-promo-themed {
    background: #000 !important;
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(118, 43, 222, 0.22) 0%, transparent 48%),
        radial-gradient(circle at 88% 75%, rgba(0, 193, 167, 0.18) 0%, transparent 48%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8) !important;
}

.audio-promo-themed::before,
.audio-promo-themed::after {
    display: none !important; /* Disable dynamic effects for the clean audio banner */
}

.audio-promo-themed:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 1), 0 0 30px rgba(118, 43, 222, 0.15) !important;
}

.audio-promo-themed .promo-title {
    font-family: var(--font-viata);
    font-weight: 800;
    letter-spacing: -1.5px;
    font-size: 2.2rem !important;
    margin-bottom: 12px;
}

.audio-promo-themed .logo-plain-play {
    font-weight: 300;
}

.audio-promo-themed .logo-audio-ext {
    font-size: 1.3rem; 
    font-weight: 400;
    margin-left: 6px;
    letter-spacing: -0.5px;
}

.audio-promo-themed .promo-btn {
    background: #fff;
    color: #000;
    box-shadow: 0 8px 18px rgba(255, 255, 255, 0.15);
    border: none;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-promo-themed .promo-btn:hover {
    background: #f0f0f0;
    color: #000;
    transform: scale(1.06) translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 255, 255, 0.25);
}

.audio-promo-themed .promo-thumb {
    display: none;
}

.audio-promo-themed .promo-copy {
    width: 100%;
    margin-left: 0 !important;
    text-align: left;
    padding: 60px 40px;
}

/* ------------ Roplay-style Modal ------------ */
.preview-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(12px);
    animation: fadeIn 0.3s ease-out;
}

.preview-modal-backdrop.show {
    display: flex;
}

.preview-modal {
    background: #181818;
    width: 95%;
    max-width: 1280px;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 1024px) {
    .preview-modal {
        flex-direction: row;
        height: 80vh;
    }
}

.preview-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
    flex-shrink: 0;
}

.preview-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

@media (min-width: 1024px) {
    .preview-player-container {
        width: 70%;
        height: auto;
    }
}

.preview-info {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #181818;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .preview-info {
        width: 30%;
        height: 100%;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.preview-info-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 101;
    background: rgba(19, 19, 31, 0.6);
    backdrop-filter: blur(8px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--primary-color);
    border-color: transparent;
}

.preview-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.meta-date {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.meta-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    color: #ccc;
    text-transform: uppercase;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.modal-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
}

.meta-label {
    color: #888;
    font-weight: bold;
}

.meta-value {
    color: #fff;
}

.modal-desc-box {
    background: #202020;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 10px;
}

.modal-desc-box h3,
.more-like-this-section h3 {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.modal-desc-box p {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.more-like-this-section {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.more-like-this-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.similar-card {
    background: #252525;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

@media (hover: hover) {
    .similar-card:hover {
        background: #333;
        transform: scale(1.02);
    }
}

.similar-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.similar-card-title {
    font-size: 0.85rem;
    padding: 12px 12px 18px;
    /* Increased bottom padding for safely showing descenders */
    color: #e5e5e5;
    font-weight: 500;
    line-height: 1.4;
    min-height: 5.5rem;
    /* Using rem for more consistent behavior across font settings */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ------------ PIP System ------------ */
/* --- PIP MODE (MINIPLAYER) --- */
.preview-modal-backdrop.pip-mode {
    background: transparent !important;
    backdrop-filter: none !important;
    pointer-events: none;
    padding: 0;
    align-items: flex-end;
    justify-content: flex-end;
}

.preview-modal-backdrop.pip-mode .preview-modal {
    width: 400px;
    height: 225px;
    max-width: 90vw;
    margin: 20px;
    pointer-events: auto;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    animation: none;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    resize: both;
    overflow: hidden !important;
    /* Required for native resize handle visibility in many browsers */
}

/* Visual Resize Hint for PiP */
.preview-modal-backdrop.pip-mode .preview-modal::after {
    content: "";
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 0 0 2px 0;
    pointer-events: none;
    /* Let the actual browser resize area handle the clicks */
    z-index: 1000;
}

.preview-modal-backdrop.pip-mode iframe {
    pointer-events: none;
}

@media (max-width: 768px) {
    .preview-modal-backdrop.pip-mode .preview-modal {
        position: fixed;
        bottom: 0;
        margin: 10px;
        width: calc(100% - 20px);
        height: 35vh;
        max-height: 250px;
    }
}

.preview-modal-backdrop.pip-mode .preview-info {
    display: none !important;
}

.preview-modal-backdrop.pip-mode .preview-player-container {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto;
}

.pip-overlay-controls {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.preview-modal-backdrop.pip-mode .pip-overlay-controls {
    display: flex;
}

.preview-modal-backdrop.pip-mode .preview-modal:hover .pip-overlay-controls {
    opacity: 1;
}

.pip-small-btn {
    background: rgba(19, 19, 31, 0.6);
    backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    font-size: 0.8rem;
}

.pip-small-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--primary-color);
    border-color: transparent;
}

.pip-trg {
    right: 65px;
}


@media (max-width: 768px) {
    #bannerCarousel {
        height: 65vh;
        min-height: 420px;
        margin-bottom: 0;
    }

    .banner-gradient {
        background: linear-gradient(0deg, var(--bg-color) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 100%),
            linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 40%);
    }

    .banner-content {
        width: 90%;
        bottom: 22%;
        /* Moved higher */
        left: 4%;
        padding: 0;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .banner-title {
        font-size: clamp(1.6rem, 5.5vw, 2.5rem);
        margin-bottom: 8px;
        line-height: 1.1;
        text-align: left;
    }

    .banner-desc {
        font-size: 0.85rem;
        margin-bottom: 18px;
        max-width: 100%;
        text-align: left;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .banner-btns {
        width: auto;
        flex-direction: row;
        gap: 10px;
    }

    .banner-btn {
        width: auto;
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 999px;
        justify-content: center;
        font-weight: 700;
    }

    .banner-btn.primary {
        background: var(--grad-mst-vibrant);
        background-size: 200% auto;
        color: #fff;
        border: none;
        box-shadow: 0 4px 15px rgba(118, 43, 222, 0.3);
    }

    .banner-btn.secondary {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    /* Resources Optimization: Disable videos on mobile, show posters ONLY */
    .banner-iframe-container {
        display: none !important;
    }

    .banner-poster {
        opacity: 1 !important;
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    #bannerIndicators {
        bottom: 30px;
        left: 4%;
        transform: none;
        gap: 8px;
    }

    .banner-dot {
        width: 8px;
        height: 8px;
        background: rgba(255, 255, 255, 0.3);
        transition: all 0.3s ease;
    }

    .banner-dot.active {
        width: 24px;
        background: #fff;
        border-radius: 10px;
    }

    .promo-wrap {
        flex-direction: column;
    }

    .promo-thumb,
    .promo-copy {
        width: 100%;
    }

    .promo-copy {
        text-align: center;
        padding: 20px;
    }

    .promo-thumb {
        height: 200px;
    }

    .preview-modal {
        height: 85vh;
        max-height: 100vh;
        border-radius: 12px 12px 0 0;
        position: absolute;
        bottom: 0;
        width: 100%;
        max-width: 100%;
    }

    .preview-info-content {
        padding: 24px 16px;
    }

    .more-like-this-grid {
        gap: 12px;
    }

    .preview-modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }
}

/* --- Notifications & Settings Global Styles --- */
.nav-notifications,
.settings-pill-btn {
    position: relative;
    background: rgba(18, 18, 22, 0.42) !important;
    backdrop-filter: blur(50px) saturate(220%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(220%) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    transition: background 0.2s, transform 0.15s !important;
    cursor: pointer;
    color: #fff !important;
    font-size: 1rem !important;
}

.settings-pill-btn {
    display: flex !important;
}

.nav-notifications:hover,
.settings-pill-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    transform: scale(1.06) !important;
    color: #fff !important;
}

.nav-notifications:active,
.settings-pill-btn:active {
    transform: scale(0.94) !important;
}

.settings-pill-btn i {
    opacity: 0.85;
}

.notif-icon {
    font-size: 1.15rem;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-icon.has-unread {
    animation: bellSwing 2s ease-in-out infinite;
    color: #fff;
}

@keyframes bellSwing {

    0%,
    100% {
        transform: rotate(0);
    }

    10%,
    30%,
    50% {
        transform: rotate(15deg);
    }

    20%,
    40% {
        transform: rotate(-15deg);
    }

    60% {
        transform: rotate(0);
    }
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #181824;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.5);
    z-index: 10;
    pointer-events: none;
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 14px rgba(255, 65, 108, 0.8); }
    100% { transform: scale(1); }
}

.notif-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background: rgba(14, 14, 24, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 2000;
}

.notif-dropdown.active {
    display: block;
}

.notif-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-clear-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
}

.notif-clear-btn:hover {
    color: #fff;
    text-decoration: underline;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notif-item:hover .notif-delete-btn {
    opacity: 1;
}

.notif-delete-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: #888;
    opacity: 0;
    transition: all 0.2s;
    z-index: 5;
}

.notif-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.notif-item.unread {
    background: rgba(118, 43, 222, 0.1);
}

.notif-item.unread::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #762BDE;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-text {
    color: #ddd;
}

.notif-text strong {
    color: #fff;
}

.notif-time {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.notif-dropdown::-webkit-scrollbar {
    width: 6px;
}

.notif-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ------------ Voting Floating Widget ------------ */
.voting-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    background: linear-gradient(135deg, #762BDE 0%, #2669F5 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-viata, 'Outfit', sans-serif);
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(118, 43, 222, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voting-float-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(118, 43, 222, 0.6);
    color: #fff;
}

.voting-float-btn i {
    font-size: 1.1rem;
    animation: bounceIcon 2s infinite;
}

@keyframes bounceIcon {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-4px);
    }

    60% {
        transform: translateY(-2px);
    }
}

/* ------------ App Version Footer ------------ */
.app-version-footer {
    width: 100%;
    padding: 60px 0 40px;
    text-align: center;
    font-family: var(--font-body), sans-serif;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    user-select: none;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-version-footer .dot {
    margin: 0 10px;
    opacity: 0.4;
}

@media (max-width: 768px) {
    .app-version-footer {
        padding: 40px 20px 30px;
        font-size: 0.65rem;
        flex-direction: column;
        gap: 8px;
    }

    .app-version-footer .dot {
        display: none;
    }
}

/* ------------ Navbar Search Bar (Desktop only) ------------ */
.nav-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 240px;
}

.nav-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.nav-search-input {
    width: 100%;
    height: 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 0 20px 0 42px;
    color: #fff;
    font-size: 0.9rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    outline: none;
    transition: all 0.3s ease;
}

.nav-search-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.nav-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    box-shadow: none;
}

/* Desktop: show navbar search, hide inline search box in controlsSection */
@media (min-width: 769px) {
    .nav-search-wrap {
        display: flex;
    }

    /* Hide only the search box item inside the filter bar (keep other filters) */
    #controlsSection .search-box-wrapper {
        display: none !important;
    }
}

/* Mobile: hide navbar search, keep the inline one in controlsSection */
@media (max-width: 768px) {
    .nav-search-wrap {
        display: none;
    }

    #controlsSection .search-box-wrapper {
        display: flex !important;
    }
}

/* ------------ No Results Message ------------ */
.no-results-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 80px 20px;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.no-results-msg i {
    font-size: 2.8rem;
    color: rgba(255, 255, 255, 0.18);
}

.no-results-msg p {
    font-family: var(--font-viata, 'Outfit', sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.no-results-msg span {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.35);
}
/* ── Custom Player Controls ─────────────────────────────────────────────── */

.cp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 12px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 20;
    pointer-events: none;
}

.preview-player-container:hover .cp-controls,
.preview-modal-backdrop.pip-mode .preview-player-container:hover .cp-controls {
    opacity: 1;
    pointer-events: all;
}

/* Progress bar */
.cp-progress {
    width: 100%;
    padding: 6px 0;
    cursor: pointer;
}

.cp-progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.cp-progress:hover .cp-progress-track {
    height: 6px;
}

.cp-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent, #a855f7);
    border-radius: 2px;
    pointer-events: none;
}

.cp-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    transition: transform 0.15s ease;
    pointer-events: none;
}

.cp-progress:hover .cp-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* Bottom row */
.cp-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 8px;
}

.cp-left, .cp-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cp-btn {
    background: none;
    border: none;
    color: white;
    font-size: 0.95rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
    flex-shrink: 0;
}

.cp-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* Volume */
.cp-volume-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cp-volume-bar {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    cursor: pointer;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    position: relative;
}

.cp-volume-wrap:hover .cp-volume-bar {
    width: 60px;
}

.cp-volume-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    pointer-events: none;
}

/* Time */
.cp-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    font-family: var(--font-viata, 'Outfit', sans-serif);
    user-select: none;
}

/* In fullscreen, always show controls on hover */
:fullscreen .cp-controls {
    pointer-events: all;
}

:fullscreen .preview-player-container:hover .cp-controls {
    opacity: 1;
}

/* Overlay that blocks YouTube's native share/logo/endscreen buttons */
.cp-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

/* Custom controls sit above the overlay */
.cp-controls {
    z-index: 20;
}

/* Continuous smooth loop marquee */
.marquee-inner {
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;
    width: max-content;
    animation: continuousMarquee 15s linear infinite !important;
    will-change: transform;
}

.marquee-spacer {
    display: inline-block;
    width: 60px;
    flex-shrink: 0;
}

.marquee-text {
    display: inline-block;
    white-space: nowrap;
}

@keyframes continuousMarquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}
