/* ========================================
   CINEMINI OTT PLATFORM - MAIN STYLES
   Dark theme with vibrant accents
   ======================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a28;
    --bg-card-hover: #222236;
    --bg-glass: rgba(26, 26, 40, 0.85);
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;

    --accent-primary: #ff4d4d;
    --accent-secondary: #ff8c00;
    --accent-gradient: linear-gradient(135deg, #ff4d4d, #ff8c00);
    --accent-glow: rgba(255, 77, 77, 0.3);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(255, 77, 77, 0.15);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    --nav-height: 60px;
    --bottom-nav-height: 65px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-height);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

/* ========================================
   TOP NAVIGATION
   ======================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95), rgba(10, 10, 15, 0.8));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    margin: 0 16px;
    position: relative;
}

.nav-search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 8px 16px 8px 40px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.nav-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.nav-search input::placeholder {
    color: var(--text-muted);
}

.nav-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.nav-actions button {
    background: none;
    color: var(--text-secondary);
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-actions button:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ========================================
   CONTENT TABS
   ======================================== */
.content-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    margin-top: calc(var(--nav-height) + 8px);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.content-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* ========================================
   HERO BANNER SLIDER
   ======================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 220px;
    margin: 12px 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 0 16px;
}

.hero-slider .slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    gap: 12px;
}

.hero-slide {
    min-width: calc(50% - 6px);
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide .slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.hero-slide .slide-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.hero-slide .slide-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background: var(--accent-primary);
    width: 20px;
    border-radius: 3px;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */
.section {
    padding: 16px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-more {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 500;
    transition: var(--transition);
}

.section-more:hover {
    color: var(--accent-secondary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 16px;
}

.content-grid.four-col {
    grid-template-columns: repeat(4, 1fr);
}

/* Content Scroll */
.content-scroll {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.content-scroll::-webkit-scrollbar {
    display: none;
}

.content-scroll .content-card {
    min-width: 130px;
    max-width: 130px;
    scroll-snap-align: start;
}

/* ========================================
   CONTENT CARD
   ======================================== */
.content-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
    cursor: pointer;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    background: var(--bg-card-hover);
}

.content-card:active {
    transform: scale(0.97);
}

.card-thumbnail {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.content-card:hover .card-thumbnail img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
}

.card-badge.multilingual {
    background: #2196F3;
}

.card-badge.english {
    background: #4CAF50;
}

.card-update {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-size: 11px;
    color: var(--text-secondary);
}

.card-info {
    padding: 8px;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   FILTER CHIPS / PILLS
   ======================================== */
.filter-row {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 6px 16px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.filter-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ========================================
   CONTENT DETAIL PAGE
   ======================================== */
.detail-hero {
    position: relative;
    height: 260px;
    overflow: hidden;
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, var(--bg-primary) 100%);
}

.detail-hero .play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.detail-hero .play-btn-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.detail-hero .play-btn-overlay svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-left: 3px;
}

.detail-back {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.detail-back:hover {
    background: var(--bg-card);
}

.detail-content {
    padding: 0 16px;
    margin-top: -40px;
    position: relative;
    z-index: 5;
}

.detail-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.detail-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-genres {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.detail-actions {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.detail-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    background: none;
    font-size: 12px;
    transition: var(--transition);
}

.detail-action-btn:hover {
    color: var(--accent-primary);
}

.detail-action-btn .icon {
    font-size: 22px;
}

.detail-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Language Tags */
.language-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lang-tag {
    padding: 4px 14px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.lang-tag.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Season Selector */
.season-selector {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.season-select-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.season-select-btn:hover {
    border-color: var(--border-hover);
}

.season-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    z-index: 100;
    overflow: hidden;
    display: none;
}

.season-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.season-option {
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.season-option:hover {
    background: var(--bg-card-hover);
}

.season-option.active {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Episode Grid */
.episode-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.episode-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.episode-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.episode-btn.active {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: linear-gradient(180deg, rgba(18, 18, 26, 0.95), rgba(10, 10, 15, 1));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item .nav-icon {
    font-size: 22px;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 3px 3px;
}

/* ========================================
   SEARCH RESULTS OVERLAY
   ======================================== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 900;
    display: none;
    padding-top: var(--nav-height);
    overflow-y: auto;
}

.search-overlay.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-results {
    padding: 16px;
}

.search-result-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-card);
    padding-left: 8px;
    border-radius: var(--radius-md);
}

.search-result-item .result-thumb {
    width: 60px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-item .result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-item .result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-item .result-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.search-result-item .result-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   LOADING & EMPTY STATES
   ======================================== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    box-shadow: var(--shadow-card);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet */
@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-slider {
        height: 300px;
    }

    .hero-slide {
        min-width: calc(33.33% - 8px);
    }

    .content-scroll .content-card {
        min-width: 160px;
        max-width: 160px;
    }

    body {
        padding-bottom: 0;
    }

    .bottom-nav {
        display: none;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .content-grid.four-col {
        grid-template-columns: repeat(6, 1fr);
    }

    .hero-slider {
        height: 400px;
        max-width: 1200px;
        margin: 12px auto;
    }

    .section {
        max-width: 1200px;
        margin: 0 auto;
    }

    .content-tabs {
        max-width: 1200px;
        margin: calc(var(--nav-height) + 8px) auto 0;
    }

    .filter-row {
        max-width: 1200px;
        margin: 0 auto;
    }

    .content-scroll .content-card {
        min-width: 180px;
        max-width: 180px;
    }

    .detail-hero {
        height: 400px;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .content-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========================================
   VIP SUBSCRIPTION BANNER
   ======================================== */
.vip-banner {
    margin: 12px 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ff8c00, #ffb347);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vip-banner .vip-info {
    flex: 1;
}

.vip-banner .vip-badge {
    font-size: 10px;
    font-weight: 800;
    color: #333;
    background: rgba(255,255,255,0.3);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.vip-banner .vip-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.vip-banner .vip-subtitle {
    font-size: 11px;
    color: #333;
}

.vip-banner .subscribe-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.vip-banner .subscribe-btn:hover {
    transform: scale(1.05);
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

/* Smooth card entrance */
.content-card {
    animation: slideUp 0.3s ease backwards;
}

.content-card:nth-child(1) { animation-delay: 0.05s; }
.content-card:nth-child(2) { animation-delay: 0.1s; }
.content-card:nth-child(3) { animation-delay: 0.15s; }
.content-card:nth-child(4) { animation-delay: 0.2s; }
.content-card:nth-child(5) { animation-delay: 0.25s; }
.content-card:nth-child(6) { animation-delay: 0.3s; }

/* Scrollbar styling for desktop */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}
