/* === ZamonaviTV Client Styles === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* === Header === */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #1e1e3a 0%, #0f0f23 100%);
    border-bottom: 1px solid var(--border);
    padding: 0 max(var(--space-lg), calc((100vw - 1200px) / 2));
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
}

.app-logo {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-balance {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

/* === Bottom Navigation === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.7rem;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    text-decoration: none;
    font-family: var(--font);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item.active,
.nav-item:hover {
    color: var(--primary-light);
}

.nav-item.active i {
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
}

/* === Desktop Navigation === */
.desktop-nav {
    display: none;
    gap: var(--space-xl);
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.desktop-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-nav a.active,
.desktop-nav a:hover {
    color: var(--primary-light);
}

@media (min-width: 1024px) {
    .bottom-nav {
        display: none !important;
    }
    .desktop-nav {
        display: flex;
    }
    .page-content {
        padding-bottom: var(--space-xl); /* Reset bottom padding without bottom-nav */
    }
}

/* === Page Layout === */
.page-content {
    padding: var(--space-lg);
    padding-bottom: 80px;
    /* space for bottom nav */
    max-width: 1200px;
    margin: 0 auto;
}

/* === Video Grid === */
.video-grid {
    display: grid;
    gap: var(--space-md);
}

/* Mobile & Tablet Full Width Edge-to-Edge */
/* Mobile & Tablet Full Width Edge-to-Edge */
@media (max-width: 1023px) {
    .video-grid {
        grid-template-columns: 1fr;
        margin-left: calc(-1 * var(--space-lg));
        margin-right: calc(-1 * var(--space-lg));
        gap: var(--space-lg);
    }

    .video-card {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .video-card .video-meta {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    /* Move stories to header on desktop */
    .stories-wrapper:not(.header-stories) {
        display: none !important;
    }
    .header-stories {
        display: flex !important;
        align-items: center;
        height: 60px;
    }
    .header-stories .stories-container {
        padding: 0;
        gap: 8px;
    }
    .header-stories .story-ring {
        width: 36px;
        height: 36px;
        margin-bottom: 0;
        border-width: 2px;
        border-radius: 50%;
    }
    .header-stories .img-placeholder {
        border-radius: 50%;
        border-width: 2px;
    }
    .header-stories .story-title {
        display: none;
    }
    .header-stories .story-item {
        width: auto;
    }
    
    /* On desktop, the first card in the featured home grid becomes a huge beautiful banner */
    .home-featured-grid .video-card:first-child {
        grid-column: 1 / -1;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: var(--radius-md) !important;
        position: relative;
    }
    .home-featured-grid .video-card:first-child:hover {
        transform: none;
        box-shadow: none !important;
        border-color: transparent !important;
    }
    .home-featured-grid .video-card:first-child .video-thumb {
        border-radius: var(--radius-md);
        /* aspect ratio inherits 16:9 natively to avoid top crop */
        aspect-ratio: 16/9;
    }
    .home-featured-grid .video-card:first-child:hover .video-thumb img {
        transform: scale(1.02); /* slight scale instead of big scale */
    }
    .home-featured-grid .video-card:first-child .video-meta {
        padding: var(--space-xl) 0;
        background: transparent;
        pointer-events: auto; /* Let card catch clicks */
    }
    .home-featured-grid .video-card:first-child .video-title {
        font-size: 2rem;
        font-weight: 800;
        line-height: 1.2;
        margin-bottom: 8px;
        color: var(--text);
    }
    .home-featured-grid .video-card:first-child .video-date {
        font-size: 1rem;
        opacity: 0.8;
    }
}

/* === Video Card === */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid transparent;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-elevated);
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.video-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity var(--transition);
}

.video-card:hover .video-play-btn {
    opacity: 1;
}

.video-play-btn i {
    font-size: 2.5rem;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}
.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 15px));
    padding: clamp(4px, 1vw, 8px) clamp(10px, 2.5vw, 18px);
    border-radius: var(--radius-full);
    font-size: clamp(0.7rem, 2vw, 1rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
    white-space: nowrap;
}

.badge-paid {
    background: rgba(75, 45, 252, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(75, 45, 252, 0.3);
}
.video-price-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: rgba(75, 45, 252, 0.75);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(75, 45, 252, 0.3);
}


.video-meta {
    padding: var(--space-sm) var(--space-md);
}

.video-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-date {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* === Section Headers === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.section-link {
    font-size: 0.85rem;
    color: var(--primary-light);
}

/* === Category Tabs === */
.category-tabs {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-lg);
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.category-tab.active,
.category-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* === Promo Banner === */
.promo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.promo-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.promo-text h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.promo-text p {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* === Profile Section === */
.profile-header {
    text-align: center;
    padding: var(--space-xl) 0;
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 auto var(--space-md);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.profile-info {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.profile-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.profile-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.profile-row i {
    color: var(--primary-light);
    width: 20px;
    text-align: center;
}

.profile-row span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-row strong {
    margin-left: auto;
    font-size: 0.9rem;
}

.menu-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    text-align: left;
}

.menu-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.menu-item:hover {
    background: var(--bg-elevated);
}

.menu-item i {
    color: var(--primary-light);
    width: 20px;
    text-align: center;
}

.menu-item .chevron {
    margin-left: auto;
    color: var(--text-dim);
}

/* === Login Page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: radial-gradient(ellipse at top, #1a1a3e 0%, var(--bg) 70%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.social-login-btns {
    display: flex;
    gap: var(--space-sm);
}

.social-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-family: var(--font);
}

.social-btn:hover {
    border-color: var(--primary);
    background: var(--bg-input);
}

.social-btn i {
    font-size: 1.1rem;
}

/* === Video Player Modal === */
.modal-backdrop:not(.story-modal) .video-modal {
    max-width: 900px;
    width: 95%;
}

.modal-backdrop.story-modal .video-modal {
    max-width: 400px;
    /* Narrow for vertical video */
}

.video-player-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 85vh;
    /* Prevent overflowing offscreen */
}

.modal-backdrop.story-modal .video-player-wrap {
    aspect-ratio: 9/16;
    /* Vertical aspect ratio */
}

.video-player-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .modal-backdrop:not(.story-modal) .video-modal {
        width: 100%;
        max-width: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .video-player-wrap {
        border-radius: 0;
        max-height: 100vh;
        width: 100%;
    }
    .video-player-wrap iframe {
        /* Fixes iOS Safari expanding iframe to video's native width */
        width: 1px !important;
        min-width: 100% !important;
        height: 100% !important;
    }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-dim);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.95rem;
}

/* === No-scroll when modal open === */
body.modal-open {
    overflow: hidden;
}

/* === Stories Component === */
.stories-wrapper {
    padding: 15px 15px 5px 15px;
    background: transparent;
    max-width: 1200px;
    margin: 0 auto;
}

.stories-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 5px;
    scrollbar-width: none;
    /* Firefox */
}

.stories-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.story-item:active {
    transform: scale(0.95);
}

.story-ring {
    width: 74px;
    height: 94px;
    border-radius: 14px;
    padding: 3px;
    /* Orange border */
    border: 2px solid #ff9800;
    background: transparent;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-ring.seen {
    background: #444;
    /* Grey for seen stories */
    box-shadow: none;
}

.story-ring .img-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 11px;
    object-fit: cover;
    border: 3px solid var(--bg);
    background-color: #222;
    background-size: cover;
    background-position: center;
}

.story-title {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    line-height: 1.25;
}

/* === Global Modal Styles (Top-up etc) === */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: var(--space-sm);
    font-size: 1.4rem;
    color: var(--text);
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}



.payment-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: white;
    padding: 4px;
    border-radius: 8px;
}

.alif-logo {
    background: transparent;
}

/* === Mobile Promos Slider === */
.mobile-promos-wrapper {
    /* Widescreen Banner at the top */
    width: 100%;
    max-width: 1280px;
    margin: 0 auto var(--space-xl) auto;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-lg);
}

.mobile-promos-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.mobile-promo-item {
    flex: 0 0 100%; /* Take full width for slider */
    cursor: pointer;
    position: relative;
}

.mobile-promo-item:active {
    transform: scale(0.95);
}

.mobile-promo-ring {
    width: 100%;
    /* Widescreen aspect ratio */
    aspect-ratio: 1280/375;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mobile-promo-ring img, .mobile-promo-ring video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: transparent;
}

.mobile-promo-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px 15px 10px 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}



/* === Dynamic Glow Background === */
#glowBgWrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background-color: #030308; /* Deep dark blue/black */
    opacity: 1;
    transition: opacity 0.8s ease;
}

#glowBgWrapper.paused {
    opacity: 0;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: orbFloat 15s infinite alternate ease-in-out;
    transform: translate(-50%, -50%);
}

.glow-orb.orb-1 {
    width: 60vw;
    height: 60vw;
    top: 10%;
    left: 0%;
    background: radial-gradient(circle, rgba(0, 80, 255, 0.7) 0%, rgba(0, 40, 255, 0) 70%);
    animation-delay: 0s;
    animation-duration: 20s;
}

.glow-orb.orb-2 {
    width: 80vw;
    height: 80vw;
    top: 80%;
    left: 100%;
    background: radial-gradient(circle, rgba(180, 0, 255, 0.6) 0%, rgba(120, 0, 255, 0) 70%);
    animation-delay: -5s;
    animation-duration: 25s;
}

.glow-orb.orb-3 {
    width: 50vw;
    height: 50vw;
    top: 100%;
    left: 20%;
    background: radial-gradient(circle, rgba(0, 180, 255, 0.5) 0%, rgba(0, 50, 255, 0) 70%);
    animation-delay: -12s;
    animation-duration: 18s;
}

@keyframes orbFloat {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.2;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translate(-35%, -65%) scale(1.3);
        opacity: 0.3;
    }
}