/* 
 * Frontend Style - IPTV Portal
 * Modern Glassmorphism & Rich Aesthetics
 */

 :root {
    /* Dark Theme Variables (Default) */
    --bg-main: #0a0a10;
    --bg-secondary: #12121c;
    --bg-card: rgba(22, 22, 34, 0.7);
    --bg-nav: rgba(18, 18, 28, 0.85);
    --text-main: #f8f8f8;
    --text-muted: #a0a0b8;
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --glass-blur: blur(12px);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

[data-theme="light"] {
    /* Light Theme Variables */
    --bg-main: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-nav: rgba(255, 255, 255, 0.95);
    --text-main: #1a1a24;
    --text-muted: #6b7280;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(12px);
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 70px; /* Space for bottom nav on mobile */
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Header & Nav */
.top-navbar {
    background: var(--bg-nav);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 15px 0;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.search-bar {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 20px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.search-bar:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    color: var(--text-main);
}

/* Hero Banner Slider */
.hero-banner {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 40px;
}

.hero-slide {
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    position: relative;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    width: 100%;
}

/* Channel Cards */
.channel-card {
    display: block;
    text-decoration: none;
    color: var(--text-main);
    padding: 20px;
    height: 100%;
    text-align: center;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    color: var(--text-main);
}

[data-theme="light"] .channel-card:hover {
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.15);
}

.channel-logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.channel-card:hover .channel-logo-wrapper {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

.channel-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.channel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Badges */
.badge-custom {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Player Section */
.player-container {
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    position: relative;
    aspect-ratio: 16 / 9;
}

#video-player {
    width: 100%;
    height: 100%;
}

/* Buttons */
.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 24px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    color: white;
}

/* Category Filters */
.category-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.category-pills::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    white-space: nowrap;
    padding: 8px 20px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.3s;
}

.cat-pill:hover, .cat-pill.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* Advertisements */
.ad-container {
    margin: 20px 0;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    padding: 15px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Mobile Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-nav);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-color);
    z-index: 1040;
    padding: 10px 0;
    padding-bottom: env(safe-area-inset-bottom, 10px); /* For iOS safe area */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

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

@media (max-width: 768px) {
    .top-navbar .desktop-nav {
        display: none !important;
    }
    .bottom-nav {
        display: flex;
        justify-content: space-around;
    }
    .hero-slide {
        height: 250px;
    }
    .hero-content {
        padding: 20px;
    }
}
