/* ==========================================================================
   OTT Seva - Black & White Glassmorphism Theme
   ========================================================================== */

:root {
    /* Color Palette - Black & White + Purple Accent */
    --bg-dark: #000000;
    --bg-darker: #050505;
    --bg-card: rgba(20, 20, 20, 0.65);
    --bg-card-hover: rgba(40, 40, 40, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.07);

    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-muted: #888888;

    --accent: #ffffff;
    /* Shift to pure white accent for black/white theme */
    --accent-glow: rgba(255, 255, 255, 0.35);
    --accent-light: #e6e6e6;
    --primary-400: #ffffff;
    --primary-500: #e6e6e6;
    --primary-600: #cfcfcf;

    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);

    /* Spacing & Layout */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Effects */
    --glass-blur: blur(14px);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.6);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    /* Subtle background texture or gradient if needed, but keeping it simple black for now */
    background: radial-gradient(circle at top right, #111 0%, #000 40%);
}

/* ==================== HEADER ==================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
    transition: var(--transition-normal);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
}

.ott-box {
    background: white;
    color: black;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.seva-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 46px;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    transition: var(--transition-fast);
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-input {
    flex: 1;
    background: transparent !important;
    border: none;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    caret-color: #fff;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Keep autofill dark */
input.search-input:-webkit-autofill,
input.search-input:-webkit-autofill:focus,
input.search-input:-webkit-autofill:hover {
    -webkit-text-fill-color: #fff;
    box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.05) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.search-icon {
    width: 20px;
    height: 20px;
    opacity: 1;
    filter: brightness(0) invert(1) drop-shadow(0 0 4px rgba(255, 255, 255, 0.4)) !important;
    cursor: pointer;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #333, #666);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== MAIN LAYOUT ==================== */
main {
    padding-top: 90px;
    padding-bottom: 120px;
    /* Mobile navigation padding */
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ==================== HORIZONTAL SECTIONS ==================== */
.category-section {
    margin-bottom: var(--spacing-xl);
    padding-left: var(--spacing-lg);
    /* Only left padding for section container */
    overflow: hidden;
    /* Hide overflow from container */
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-right: var(--spacing-lg);
    /* Add padding right for header */
}

.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.see-all-btn {
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.see-all-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Horizontal Scroll Container */
.movie-grid {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    padding-bottom: var(--spacing-md);
    /* Space for scrollbar */
    padding-right: var(--spacing-lg);
    /* End padding */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Custom Scrollbar */
.movie-grid::-webkit-scrollbar {
    height: 6px;
}

.movie-grid::-webkit-scrollbar-track {
    background: transparent;
}

.movie-grid::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.movie-grid:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.4);
}

/* Movie Card */
.movie-card {
    flex: 0 0 auto;
    /* Don't shrink */
    width: 160px;
    /* Phone default */
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
    background: var(--bg-card);
    aspect-ratio: 2/3;
    border: var(--glass-border);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-md);
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

/* Live TV Channel Logo - Centered and contained */
.movie-card.livetv-card img {
    object-fit: contain;
    object-position: center;
    background: #111;
    padding: 10%;
}

/* Card Tag (Movies/Series/Live) */
.card-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hover Effect */
.movie-card:hover {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.movie-card:hover img {
    filter: brightness(0.6);
}

.movie-card h3 {
    display: none;
    /* Hide title by default, show on hover or overlay */
}

/* Play Icon Overlay */
.vignette-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
    padding: var(--spacing-md);
    text-align: center;
}

.movie-card:hover .vignette-overlay {
    opacity: 1;
}

.vignette-overlay img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    filter: invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    object-fit: contain;
    background: transparent !important;
}

.vignette-overlay span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Responsive Grid Sizes */
@media (min-width: 768px) {
    .movie-card {
        width: 180px;
    }
}

@media (min-width: 1200px) {
    .movie-card {
        width: 200px;
    }
}

/* ==================== SKELETON LOADING ==================== */
.skeleton {
    flex: 0 0 auto;
    width: 160px;
    aspect-ratio: 2/3;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-top: var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px 0;
    /* Extra bottom padding for mobile home bar */
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

.nav-item img {
    width: 24px;
    height: 24px;
    opacity: 1;
    filter: brightness(0) invert(1) contrast(1.1) !important;
    /* Force white icons */
    transition: var(--transition-fast);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active img {
    opacity: 1;
}

.nav-item:hover {
    color: white;
}

.nav-item:hover img {
    opacity: 1;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: #000;
    color: #fff;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: #111;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-play {
    background: #000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

/* ==================== DETAILS PAGE ==================== */
.details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    padding-bottom: 160px;
}

.details-hero {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.details-poster {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: var(--glass-border);
}

.details-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.details-info {
    flex: 1;
}

.details-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.details-meta span {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
}

.details-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

/* Responsive Details */
@media (min-width: 768px) {
    .details-hero {
        flex-direction: row;
        align-items: flex-start;
    }

    .details-poster {
        margin: 0;
    }
}

@media (max-width: 640px) {
    main {
        padding-bottom: 180px;
    }

    .play-options .btn,
    .play-options .btn-play {
        width: 100%;
        text-align: center;
    }

    .details-description {
        font-size: 0.95rem;
    }
}

/* ==================== ERROR / EMPTY STATES ==================== */
.error-message {
    text-align: center;
    padding: var(--spacing-2xl);
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 50, 50, 0.3);
    border-radius: var(--radius-lg);
    color: #ff6b6b;
}

.empty-message {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
    width: 100%;
}

/* ==================== MOBILE HEADER STYLES ==================== */
/* Desktop/Mobile visibility */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }

    /* Make search bar hidden on mobile */
    .search-bar.desktop-only {
        display: none !important;
    }

    /* Header actions - search & account side by side */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 7px;
    }
    
    /* Mobile search icon */
    .header-actions .search-icon.mobile-only {
        display: block !important;
        width: 36px;
        height: 36px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        box-sizing: border-box;
        cursor: pointer;
    }

    /* Make user menu just an icon on mobile */
    .user-name {
        display: none;
    }

    .user-menu {
        padding: 0;
        border-radius: 50%;
        background: transparent;
        border: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Adjust header spacing */
    .header-content {
        gap: var(--spacing-sm);
    }

    .ott-box {
        padding: 4px 8px;
        font-size: 0.95rem;
    }

    .seva-text {
        font-size: 1.1rem;
    }

    /* Smaller movie cards on mobile */
    .movie-card {
        min-width: 120px;
        max-width: 120px;
    }

    .movie-card img {
        height: 180px;
    }

    /* Category title adjustments */
    .category-title {
        font-size: 1rem;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .category-header {
        flex-wrap: nowrap;
        gap: var(--spacing-sm);
    }

    .see-all-btn {
        font-size: 0.75rem;
        padding: 4px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Smaller card tags */
    .card-tag {
        font-size: 0.55rem;
        padding: 2px 6px;
    }
}