/* HALLOPlay WebPlayer - Main Styles */
/* Dark theme with CSS Custom Properties */

:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #242424;
    --bg-card-hover: #2a2a2a;

    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;

    --accent-color: #e50914;
    --accent-hover: #f40612;
    --accent-dark: #b20710;

    --success-color: #46d369;
    --warning-color: #ffc107;
    --error-color: #e50914;

    /* Focus (Smart TV) */
    --focus-color: #ffffff;
    --focus-border-width: 3px;
    --focus-glow: 0 0 20px rgba(229, 9, 20, 0.5);

    /* Spacing */
    --sidebar-width: 80px;
    --sidebar-expanded: 200px;
    --content-padding: 40px;
    --card-gap: 16px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;
    --font-size-3xl: 48px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
}

/* Hide scrollbar but allow scroll */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* Buttons reset */
button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    outline: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* SVG Icons */
svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
}

/* ==================== SPLASH SCREEN ==================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    width: 250px;
    height: auto;
    animation: pulse 2s ease-in-out infinite;
}

.splash-loader {
    width: 50px;
    height: 50px;
    margin: 30px auto 0;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar:hover,
.sidebar.expanded {
    width: var(--sidebar-expanded);
}

.sidebar-logo {
    padding: 10px 15px 30px;
    text-align: center;
}

.sidebar-logo img {
    width: 100%;
    max-width: 150px;
    margin: 0 auto;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    margin: 4px 10px;
    border-radius: var(--radius-md);
    position: relative;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

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

.menu-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.menu-label {
    margin-left: 16px;
    font-size: var(--font-size-md);
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-normal);
}

.sidebar:hover .menu-label,
.sidebar.expanded .menu-label {
    opacity: 1;
    transform: translateX(0);
}

.focus-bar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent-color);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-fast);
}

.menu-item.active .focus-bar {
    height: 60%;
}

.menu-spacer {
    flex: 1;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.page {
    min-height: 100vh;
    padding: var(--content-padding);
    padding-left: 60px;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
}

/* ==================== SECTION ==================== */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.section-link {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.section-link:hover {
    color: var(--text-primary);
}

/* ==================== GRID LAYOUTS ==================== */
.grid {
    display: grid;
    gap: var(--card-gap);
}

.grid-movies {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.grid-channels {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ==================== BACKDROP ==================== */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: -1;
    overflow: hidden;
}

.backdrop::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0) 0%,
        rgba(10, 10, 10, 0.5) 50%,
        rgba(10, 10, 10, 1) 100%
    );
}

.backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity var(--transition-slow);
}

/* ==================== HERO SECTION ==================== */
.hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    padding: 40px;
    margin-bottom: 40px;
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(10, 10, 10, 0.9) 0%,
        rgba(10, 10, 10, 0.5) 50%,
        transparent 100%
    );
}

.hero-content {
    position: relative;
    max-width: 500px;
}

.hero-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-description {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.hero-rating {
    color: var(--success-color);
    font-weight: 600;
}

.hero-buttons {
    display: flex;
    gap: 12px;
}

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

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.85);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-accent {
    background: var(--accent-color);
    color: var(--text-primary);
}

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn svg {
    width: 20px;
    height: 20px;
}

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== AD BANNERS ==================== */
.ad-banner {
    width: 100%;
    max-width: 970px;
    min-width: 300px;
    margin: 20px auto;
    text-align: center;
    background: transparent;
    min-height: 250px;
    display: block;
    overflow: hidden;
}

.ad-banner ins {
    margin: 0 auto;
}

.ad-banner-top {
    margin-top: 10px;
    margin-bottom: 40px;
}

.ad-banner-bottom {
    margin-top: 50px;
    margin-bottom: 30px;
}

.ad-banner ins {
    background: transparent;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    :root {
        --content-padding: 30px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 60px;
        --sidebar-expanded: 60px;
        --content-padding: 20px;
    }

    .menu-label {
        display: none;
    }

    .hero {
        height: 40vh;
        min-height: 300px;
    }

    .hero-title {
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        flex-direction: row;
        padding: 10px;
        background: var(--bg-secondary);
    }

    .sidebar-logo {
        display: none;
    }

    .sidebar-menu {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }

    .menu-item {
        flex-direction: column;
        padding: 10px;
        margin: 0;
    }

    .menu-spacer {
        display: none;
    }

    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
    }
}
