/* ========================================
   AIRON TV - OTT Platform Design System
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #E50914;
    --primary-hover: #F40612;
    --secondary: #564D4D;
    --background: #141414;
    --surface: #1a1a1a;
    --surface-hover: #2a2a2a;
    --surface-light: #333333;
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --text-muted: #808080;
    --accent: #46D369;
    --warning: #F5C518;
    --error: #E87C03;
    --live: #E50914;
    --gradient-primary: linear-gradient(180deg, transparent 0%, rgba(20, 20, 20, 0.8) 50%, #141414 100%);
    --gradient-hover: linear-gradient(180deg, transparent 0%, rgba(229, 9, 20, 0.3) 100%);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Roboto Condensed', var(--font-primary);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(229, 9, 20, 0.4);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-modal: 200;
    --z-header: 300;
    --z-toast: 400;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul,
ol {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.text-brand {
    color: var(--primary);
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-2xl);
}

/* ========================================
   HEADER
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    padding: var(--space-md) 0;
    transition: background var(--transition-normal);
}

.header.scrolled {
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -1px;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.main-nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text-primary);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* Search */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    transition: all var(--transition-normal);
}

.search-box .search-icon {
    font-size: 1.125rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1;
    padding: var(--space-sm);
    transition: color var(--transition-fast);
}

.search-box .search-icon:hover {
    color: var(--text-primary);
}

.search-box input {
    width: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    opacity: 0;
    outline: none;
}

.search-box.active {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--surface-light);
    border-radius: var(--radius-sm);
    padding-right: var(--space-sm);
}

.search-box.active input {
    width: 200px;
    padding: var(--space-sm);
    opacity: 1;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.user-avatar:hover {
    border-color: var(--text-primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-md));
    right: 0;
    width: 200px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--surface-light);
    margin: var(--space-sm) 0;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-primary);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(109, 109, 110, 0.7);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(109, 109, 110, 0.5);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--text-primary);
    color: var(--background);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    padding-bottom: var(--space-3xl);
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--primary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.hero-meta .rating {
    color: var(--warning);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
}

/* ========================================
   CONTENT ROWS
   ======================================== */

.content-section {
    padding: var(--space-xl) 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 1.375rem;
    font-weight: 700;
}

.section-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.section-link:hover {
    color: var(--text-primary);
}

/* Content Slider */
.content-slider {
    position: relative;
    margin: 0 calc(var(--space-lg) * -1);
    padding: 0 var(--space-lg);
}

.content-slider-track {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-sm) 0;
}

.content-slider-track::-webkit-scrollbar {
    display: none;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 100%;
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.9), transparent);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.content-slider:hover .slider-btn {
    opacity: 1;
}

.slider-btn.prev {
    left: 0;
}

.slider-btn.next {
    right: 0;
    background: linear-gradient(-90deg, rgba(20, 20, 20, 0.9), transparent);
}

/* ========================================
   CONTENT CARDS
   ======================================== */

.content-card {
    flex: 0 0 auto;
    width: 200px;
    scroll-snap-align: start;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
}

.content-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.content-card-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.content-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.content-card:hover .content-card-poster img {
    transform: scale(1.1);
}

.content-card-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.content-card:hover .content-card-overlay {
    opacity: 1;
}

.content-card-overlay .play-btn {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transform: scale(0.8);
    transition: transform var(--transition-fast);
}

.content-card:hover .content-card-overlay .play-btn {
    transform: scale(1);
}

.content-card-info {
    padding: var(--space-sm);
}

.content-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-xs);
}

.content-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--warning);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.badge-live {
    background: var(--live);
    color: white;
    animation: pulse 2s infinite;
}

.badge-new {
    background: var(--accent);
    color: var(--background);
}

.badge-premium {
    background: var(--warning);
    color: var(--background);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ========================================
   LIVE CHANNELS
   ======================================== */

.channel-card {
    flex: 0 0 auto;
    width: 280px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.channel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.channel-card-preview {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--background);
}

.channel-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-card-live {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
}

.channel-card-viewers {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.channel-card-body {
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.channel-logo {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: var(--radius-md);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.channel-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.channel-info p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--surface);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand .logo {
    margin-bottom: var(--space-md);
}

.footer-brand p {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 300px;
}

.footer-nav h5 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.footer-nav ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-nav a {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-nav a:hover {
    color: var(--text-primary);
}

.footer-social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: var(--surface-hover);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary);
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--surface-light);
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .footer-brand {
        grid-column: span 3;
    }
}

@media (max-width: 992px) {
    .container-fluid {
        padding: 0 var(--space-lg);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .content-card {
        width: 160px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .hero {
        height: 70vh;
        min-height: 500px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: span 2;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .content-card {
        width: 140px;
    }

    .channel-card {
        width: 260px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: span 1;
    }
}