/**
 * ===================================================
 * OKRA TV - ESTILOS PREMIUM
 * ===================================================
 * 
 * Design inspirado em apps IPTV profissionais:
 * - TiviMate
 * - IPTV Smarters Pro
 * - Perfect Player
 * 
 * Características:
 * - Glassmorphism (efeito vidro)
 * - Gradientes suaves
 * - Animações fluidas
 * - Layout imersivo
 */

/* ===== FONTES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== VARIÁVEIS CSS ===== */
:root {
    /* Cores principais - Tema escuro premium */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(20, 20, 30, 0.85);
    --bg-glass-light: rgba(255, 255, 255, 0.05);
    
    /* Cores de destaque - Gradiente premium */
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-tertiary: #c084fc;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
    --accent-gradient-hover: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    
    /* Cores de texto */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --text-accent: #a855f7;
    
    /* Cores de estado */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.3);
    --info: #3b82f6;
    --live: #ef4444;
    
    /* Favorito */
    --favorite-active: #fbbf24;
    --favorite-glow: rgba(251, 191, 36, 0.4);
    
    /* Dimensões */
    --header-height: 72px;
    --sidebar-width: 380px;
    --sidebar-collapsed: 80px;
    --player-controls-height: 60px;
    
    /* Bordas e efeitos */
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(124, 58, 237, 0.3);
    
    /* Sombras premium */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    
    /* Blur (glassmorphism) */
    --blur-sm: blur(8px);
    --blur: blur(20px);
    --blur-lg: blur(40px);
    
    /* Transições */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-index */
    --z-sidebar: 100;
    --z-header: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-loader: 500;
    --z-toast: 1000;
}


/* ===== RESET E BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    
    /* Background gradient sutil */
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Seleção de texto */
::selection {
    background: var(--accent-primary);
    color: var(--text-primary);
}


/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}


/* ===== TELA DE LOGIN PREMIUM ===== */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(180deg, rgba(5, 2, 15, 0.75) 0%, rgba(10, 5, 25, 0.65) 40%, rgba(5, 2, 15, 0.85) 100%),
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?w=1920&q=80') center/cover no-repeat;
    z-index: 9999;
    overflow: hidden;
}

/* Scanlines overlay */
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.008) 2px,
        rgba(255, 255, 255, 0.008) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Noise texture */
.login-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.login-screen.hidden {
    display: none !important;
}

/* Efeitos de fundo */
.login-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: floatOrb 20s ease-in-out infinite;
}

.login-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.login-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    bottom: -120px;
    right: -120px;
    animation-delay: -6s;
}

.login-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #a855f7 0%, transparent 70%);
    top: 40%;
    left: 55%;
    animation-delay: -12s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(40px, -50px) scale(1.15); }
    40% { transform: translate(-30px, 30px) scale(0.85); }
    60% { transform: translate(50px, 40px) scale(1.1); }
    80% { transform: translate(-40px, -30px) scale(0.95); }
}

/* Card de login */
.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    background: rgba(15, 10, 25, 0.65);
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--border-radius-xl);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(124, 58, 237, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: loginCardIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo-svg {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.5)) drop-shadow(0 0 60px rgba(124, 58, 237, 0.2));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.5)) drop-shadow(0 0 60px rgba(124, 58, 237, 0.2)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.7)) drop-shadow(0 0 80px rgba(124, 58, 237, 0.3)); transform: scale(1.03); }
}

.login-logo-icon {
    display: none;
}

.login-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Tabs do login */
.login-mode-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 4px;
    margin-bottom: 28px;
}

.login-mode-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: calc(var(--border-radius) - 4px);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-mode-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.login-mode-tab.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Formulário */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-field input {
    height: 50px;
    padding: 0 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.login-field input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-card-hover);
}

.login-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* Wrapper do campo de senha */
.login-password-wrapper {
    position: relative;
}

.login-password-wrapper input {
    width: 100%;
    padding-right: 50px;
}

.toggle-pass-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.toggle-pass-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Checkbox lembrar */
.login-remember {
    display: flex;
    align-items: center;
}

.login-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}

.login-checkbox input[type="checkbox"] {
    display: none;
}

.login-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.login-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.login-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Botão de submit */
.login-submit-btn {
    width: 100%;
    height: 52px;
    font-size: 1rem;
    margin-top: 4px;
}

/* Divisor "ou" */
.login-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    gap: 12px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.login-divider span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Botão Entrar sem conta */
.login-static-btn {
    width: 100%;
    height: 48px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.login-static-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.4);
    color: var(--text-primary);
}

.login-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== BOTÃO INSTALAR APP (PWA) ===== */

/* Botão na tela de login */
.btn-install-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px dashed rgba(124, 58, 237, 0.5);
    border-radius: var(--border-radius);
    color: #c4b5fd;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: installPulse 2.5s ease-in-out infinite;
}

.btn-install-app:hover,
.btn-install-app:focus {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(99, 102, 241, 0.3));
    border-color: #7c3aed;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.btn-install-app svg {
    flex-shrink: 0;
}

@keyframes installPulse {
    0%, 100% { border-color: rgba(124, 58, 237, 0.3); }
    50% { border-color: rgba(124, 58, 237, 0.7); }
}

/* Botão no header */
.btn-install-header {
    padding: 8px 16px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    border: none;
    border-radius: var(--border-radius);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-install-header:hover,
.btn-install-header:focus {
    background: linear-gradient(135deg, #6d28d9, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* TV: botões maiores para controle remoto */
@media (min-width: 1200px) and (pointer: coarse),
       (min-width: 1200px) and (any-hover: none) {
    .btn-install-app {
        padding: 18px 32px;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    .btn-install-header {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* TV: foco visível para navegação com controle remoto */
.btn-install-app:focus-visible,
.btn-install-header:focus-visible {
    outline: 3px solid #a855f7;
    outline-offset: 3px;
}

/* Header - user info e logout */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.btn-logout {
    padding: 8px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
    transform: translateY(-1px);
}

/* ===== BOTÃO CONFIGURAÇÕES ===== */
.btn-settings {
    padding: 8px 18px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--border-radius);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-settings:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== MODAL DE CONFIGURAÇÕES ===== */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.settings-modal.hidden {
    display: none;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.settings-header h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.settings-field input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.settings-field input:focus {
    border-color: var(--primary);
}

.settings-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.settings-actions .btn {
    flex: 1;
}


/* ===== HEADER PREMIUM ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: var(--z-header);
    transition: background 0.4s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .highlight {
    font-weight: 300;
    opacity: 0.9;
}


/* ===== SIDEBAR PREMIUM ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
}

/* Busca premium */
.search-container {
    padding: 20px;
    position: relative;
}

#search-input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-normal);
}

#search-input:hover {
    background: var(--bg-card-hover);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

#clear-search {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

#clear-search:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* Filtros premium */
.filter-tabs {
    display: flex;
    padding: 0 20px 12px;
    gap: 8px;
}

/* ===== CATEGORIAS (TV ao Vivo, Filmes, Séries) ===== */
.category-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 0 20px 16px;
}

.category-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.category-tab .cat-icon {
    font-size: 1.5rem;
    transition: transform var(--transition-normal);
}

.category-tab .cat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.category-tab .cat-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.category-tab:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.category-tab:hover .cat-icon {
    transform: scale(1.15);
}

.category-tab.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.category-tab.active .cat-count {
    background: var(--accent-primary);
    color: white;
}

.category-tab.active .cat-icon {
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 3px 3px 0 0;
}

.filter-tab {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.filter-tab span {
    position: relative;
    z-index: 1;
}

.filter-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.filter-tab.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.filter-tab.active::before {
    opacity: 1;
}

/* Lista de canais premium */
.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

/* Item de canal premium */
.channel-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

/* Efeito de brilho no hover */
.channel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.5s ease;
}

.channel-item:hover::before {
    left: 100%;
}

.channel-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.channel-item:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Canal ativo */
.channel-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.channel-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
}

/* Indicador LIVE */
.channel-item.active .channel-number::after {
    content: 'LIVE';
    margin-left: 8px;
    padding: 2px 6px;
    background: var(--live);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Logo do canal */
.channel-logo {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    padding: 6px;
    transition: transform var(--transition-normal);
}

.channel-item:hover .channel-logo {
    transform: scale(1.05);
}

.channel-logo-placeholder {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Info do canal */
.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.channel-number {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Badges de categoria nos itens de canal */
.category-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.badge-live {
    background: linear-gradient(135deg, var(--live) 0%, #dc2626 100%);
    color: white;
}

.badge-movie {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.badge-series {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

/* Botão favorito premium */
.favorite-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-bounce);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    color: var(--favorite-active);
    transform: scale(1.2);
    background: rgba(251, 191, 36, 0.1);
}

.favorite-btn.active {
    color: var(--favorite-active);
    filter: drop-shadow(0 0 8px var(--favorite-glow));
    animation: star-pop 0.3s ease;
}

@keyframes star-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Estado vazio */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 200px;
}

/* Trigger para carregar mais canais */
.load-more-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
}

.load-more-text {
    font-size: 0.85rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== GRUPOS COLAPSÁVEIS ===== */
.channel-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, padding-left 0.2s;
    position: sticky;
    top: 0;
    z-index: 2;
}

.group-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.group-header.open {
    background: rgba(139, 92, 246, 0.08);
    border-left: 3px solid var(--primary);
    padding-left: 13px;
}

.group-toggle {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    min-width: 12px;
}

.group-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.group-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.group-content.collapsed {
    max-height: 0 !important;
    overflow: hidden;
}

/* Indentação para subgrupos (temporadas dentro de séries) */
.group-series > .group-content > .channel-group {
    margin-left: 0;
}

.group-season .group-header {
    padding-left: 28px;
    background: rgba(255, 255, 255, 0.01);
    font-size: 0.8rem;
}

.group-season .group-header.open {
    background: rgba(139, 92, 246, 0.05);
    padding-left: 25px;
}

.group-season .group-content .channel-item {
    padding-left: 40px;
}

/* Cores por tipo de grupo */
.group-category .group-header.open {
    border-left-color: #10b981;
}

.group-live .group-header.open {
    border-left-color: #ef4444;
}

.group-movies .group-header.open {
    border-left-color: #3b82f6;
}

.group-series .group-header.open {
    border-left-color: #a855f7;
}

.group-season .group-header.open {
    border-left-color: #f59e0b;
}

/* Botão "mostrar mais" dentro de grupo */
.group-load-more {
    width: 100%;
    padding: 10px 16px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px dashed rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    margin: 4px 8px;
    transition: background 0.2s;
}

.group-load-more:hover {
    background: rgba(139, 92, 246, 0.12);
}

/* ===== GRID MODE - SIDEBAR FULL WIDTH ===== */
.main-content.grid-mode .sidebar {
    width: 100%;
    min-width: 100%;
    flex: 1;
    border-right: none;
}

.main-content.grid-mode .player-section {
    display: none;
}

.main-content.grid-mode .channel-list {
    overflow: visible;
}

/* ===== PLAYER OVERLAY (quando clica num canal em grid mode) ===== */
.main-content.grid-mode.player-overlay-active .player-section {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-primary);
    flex-direction: column;
    animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.player-overlay-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    backdrop-filter: blur(8px);
}

.player-overlay-back:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* ===== LAYOUT SÉRIES - SIDEBAR + GRID ===== */
.series-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.series-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.series-sidebar-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.series-cat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: left;
    transition: all 0.15s;
}

.series-cat-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.series-cat-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-left-color: var(--primary);
    color: var(--text-primary);
    font-weight: 600;
}

.series-cat-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.series-cat-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
}

.series-cat-btn.active .series-cat-count {
    background: rgba(139, 92, 246, 0.3);
    color: var(--primary-light, #c4b5fd);
}

/* Grid de cards */
.series-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 16px;
    align-content: start;
}

.series-card {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.03);
}

.series-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.series-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.series-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.series-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
}

.series-card-fav {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #aaa;
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.series-card:hover .series-card-fav {
    opacity: 1;
}

.series-card-fav.active {
    color: #fbbf24;
    opacity: 1;
}

.series-card-title {
    padding: 8px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.series-load-more {
    grid-column: 1 / -1;
    padding: 12px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px dashed rgba(139, 92, 246, 0.25);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.series-load-more:hover {
    background: rgba(139, 92, 246, 0.15);
}

/* Responsive: sidebar collapses on small screens */
@media (max-width: 600px) {
    .series-layout {
        flex-direction: column;
    }
    .series-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 140px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-wrap: wrap;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .series-sidebar-header {
        width: 100%;
        padding: 8px 12px;
    }
    .series-cat-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    .series-cat-btn.active {
        border-bottom-color: var(--primary);
        border-left-color: transparent;
    }
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
        padding: 8px;
    }
}

/* Contador de canais */
.channel-counter {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#visible-count {
    color: var(--accent-secondary);
    font-weight: 600;
}


/* ===== SEÇÃO DO PLAYER PREMIUM ===== */
.player-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--bg-primary);
    position: relative;
}

/* Info do canal atual - Estilo EPG */
.now-playing {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px 24px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* Gradiente decorativo */
.now-playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.current-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    object-fit: contain;
    background: var(--bg-card);
    padding: 8px;
}

.current-logo.hidden {
    display: none;
}

.current-info {
    flex: 1;
}

.current-info h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Badge LIVE */
.current-info h2::after {
    content: '● AO VIVO';
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    background: var(--live);
    color: white;
    border-radius: 20px;
    animation: pulse-live 2s infinite;
}

.current-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Container do Player */
.player-container {
    position: relative;
    flex: 1;
    background: #000;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    min-height: 450px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Video.js customizado premium */
#video-player {
    width: 100%;
    height: 100%;
}

.video-js {
    font-family: inherit;
}

.video-js .vjs-big-play-button {
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin-top: -40px;
    margin-left: -40px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-normal);
}

.video-js .vjs-big-play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 60px var(--accent-glow);
}

.video-js .vjs-big-play-button .vjs-icon-placeholder::before {
    font-size: 2.5rem;
}

.video-js .vjs-control-bar {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    height: 60px;
    padding: 0 16px;
}

.video-js .vjs-play-progress,
.video-js .vjs-volume-level {
    background: var(--accent-gradient);
}

.video-js .vjs-load-progress {
    background: rgba(255, 255, 255, 0.2);
}

.video-js .vjs-slider {
    background: rgba(255, 255, 255, 0.15);
}

.video-js .vjs-time-control {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Loader do player premium */
.player-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: var(--blur-sm);
    z-index: 10;
}

/* Erro do player premium */
.player-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: var(--blur-sm);
    z-index: 15;
    text-align: center;
    padding: 40px;
}

.player-error .error-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px var(--error-glow));
}

.player-error p {
    color: var(--error);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 24px;
}

/* ===== DRAMIO - CATÁLOGO NATIVO ===== */
.dramio-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 450px;
    scroll-behavior: smooth;
}

/* --- CAROUSEL --- */
.dramio-carousel {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--border-radius-lg);
    margin-bottom: 16px;
}

.dramio-carousel-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.6s ease;
}

.dramio-carousel-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.4) 50%, rgba(10,10,15,0.2) 100%);
}

.dramio-carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 2;
}

.dramio-badge-new {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.dramio-carousel-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    line-height: 1.2;
}

.dramio-carousel-synopsis {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    margin: 0 0 12px 0;
    max-width: 480px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dramio-carousel-actions {
    display: flex;
    gap: 10px;
}

.dramio-watch-btn {
    padding: 10px 24px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
}

.dramio-carousel-dots {
    position: absolute;
    bottom: 10px;
    right: 24px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.dramio-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
}

.dramio-carousel-dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

/* --- BUSCADOR --- */
.dramio-search-wrapper {
    padding: 8px 8px 4px;
    flex-shrink: 0;
}

.dramio-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 12px;
    transition: border-color 0.2s;
}

.dramio-search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(124,58,237,0.15);
}

.dramio-search-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.5;
}

.dramio-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    padding: 10px 0;
    min-width: 0;
}

.dramio-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.dramio-search-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.dramio-search-clear:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

.dramio-search-results-info {
    padding: 2px 12px 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* --- FILTROS --- */
.dramio-filters {
    display: flex;
    gap: 8px;
    padding: 0 8px 12px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}

.dramio-filters::-webkit-scrollbar {
    display: none;
}

.dramio-genre-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.dramio-genre-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dramio-genre-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* --- GRID --- */
.dramio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 0 8px 16px;
}

.dramio-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bg-secondary);
    aspect-ratio: 2/3;
}

.dramio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.25);
}

.dramio-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.dramio-card:hover .dramio-card-img {
    transform: scale(1.05);
}

.dramio-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.dramio-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dramio-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
}

.dramio-card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.dramio-card-badge-dub {
    background: #059669;
}

.dramio-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(124,58,237,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    pointer-events: none;
}

.dramio-card-play::after {
    content: '▶';
    color: #fff;
    font-size: 16px;
    margin-left: 2px;
}

.dramio-card-fav {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.55);
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.2s;
    opacity: 1;
    pointer-events: auto;
    line-height: 1;
}

.dramio-card-fav:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.15);
}

.dramio-card-fav.active {
    color: #ef4444;
}

.dramio-fav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.dramio-fav-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.4);
}

.dramio-fav-btn.active {
    background: rgba(239,68,68,0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.dramio-card:hover .dramio-card-play {
    transform: translate(-50%, -50%) scale(1);
}

/* --- LOADER --- */
.dramio-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.95);
    z-index: 10;
}

.dramio-loader p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- PLAYER PAGE --- */
/* === PLAYER + DETALHES DO DORAMA === */
.dramio-details {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 5;
    overflow-y: auto;
}

.dramio-player-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.dramio-player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.9);
    flex-shrink: 0;
    z-index: 2;
}

.dramio-player-title {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dramio-details-back {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 14px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.dramio-details-back:hover {
    background: rgba(255,255,255,0.22);
}

.dramio-player-video {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 220px;
    background: #000;
}

.dramio-player-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.dramio-details-info {
    padding: 14px 16px;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.dramio-details-meta {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.dramio-details-meta span:empty {
    display: none;
}

.dramio-details-synopsis {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
}

.dramio-details-genres {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* --- EMPTY STATE --- */
.dramio-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--text-secondary);
    text-align: center;
}

.dramio-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* --- FULLSCREEN --- */
.dramio-details:fullscreen {
    border-radius: 0;
}

.dramio-details:fullscreen .dramio-details-info {
    display: none;
}

.dramio-details:fullscreen .dramio-player-video {
    min-height: 100vh;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    .dramio-container {
        min-height: 100%;
    }

    .dramio-carousel {
        height: 200px;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .dramio-carousel-title {
        font-size: 1rem;
    }

    .dramio-carousel-synopsis {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }

    .dramio-carousel-content {
        padding: 12px;
    }

    .dramio-watch-btn {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }

    .dramio-badge-new {
        font-size: 0.6rem;
        padding: 2px 7px;
    }

    .dramio-search-wrapper {
        padding: 6px 6px 2px;
    }

    .dramio-search-input {
        font-size: 0.82rem;
        padding: 8px 0;
    }

    .dramio-filters {
        padding: 0 6px 8px;
        gap: 6px;
    }

    .dramio-genre-btn {
        padding: 5px 12px;
        font-size: 0.72rem;
    }

    .dramio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 0 6px 12px;
    }

    .dramio-card {
        border-radius: 8px;
    }

    .dramio-card-title {
        font-size: 0.65rem;
    }

    .dramio-card-meta {
        font-size: 0.58rem;
    }

    .dramio-card-overlay {
        padding: 20px 6px 6px;
    }

    .dramio-card-badge {
        font-size: 0.5rem;
        padding: 1px 4px;
        top: 4px;
        left: 4px;
    }

    .dramio-card-play {
        width: 32px;
        height: 32px;
    }

    .dramio-card-play::after {
        font-size: 12px;
    }

    /* Player mobile */
    .dramio-player-header {
        padding: 6px 8px;
        gap: 8px;
    }

    .dramio-player-title {
        font-size: 0.8rem;
    }

    .dramio-details-back {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .dramio-player-video {
        min-height: 200px;
        flex: 0 0 auto;
        aspect-ratio: 16/9;
    }

    .dramio-details-info {
        padding: 10px 12px;
    }

    .dramio-details-meta {
        font-size: 0.75rem;
        gap: 10px;
        margin-bottom: 6px;
    }

    .dramio-details-synopsis {
        font-size: 0.78rem;
        max-height: 60px;
        line-height: 1.4;
    }

    .dramio-details-genres {
        gap: 4px;
    }

    .dramio-genre-tag {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .dramio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 0 4px 10px;
    }

    .dramio-carousel {
        height: 170px;
    }

    .dramio-card-title {
        font-size: 0.6rem;
    }
}

/* Controles TV premium */
.tv-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.tv-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.tv-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tv-btn:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.tv-btn span {
    font-size: 1.1rem;
}


/* ===== BOTÕES PREMIUM ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-icon {
    font-size: 1rem;
}


/* ===== LOADER GLOBAL PREMIUM ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: var(--blur);
    z-index: var(--z-loader);
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loader-spinner::before {
    content: '';
    position: absolute;
    inset: -3px;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite reverse;
}

.loader p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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


/* ===== TOAST NOTIFICATIONS PREMIUM ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: var(--z-toast);
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 420px;
    border: 1px solid var(--border-color);
}

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

.toast-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px currentColor);
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

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


/* ===== FOOTER PREMIUM ===== */
.footer {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ===== ESTADOS ===== */
.hidden {
    display: none !important;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}


/* ===== RESPONSIVIDADE ===== */

/* Tablets */
@media (max-width: 1200px) {
    .sidebar {
        width: 320px;
        min-width: 320px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
        --sidebar-width: 100%;
    }
    
    /* Login screen mobile */
    .login-card {
        max-width: 100%;
        margin: 12px;
        padding: 28px 20px;
        border-radius: var(--border-radius-lg);
    }
    
    .login-logo-svg {
        width: 60px;
        height: 60px;
    }
    
    .login-logo-icon {
        display: none;
    }
    
    .login-title {
        font-size: 1.4rem;
    }
    
    .login-subtitle {
        font-size: 0.8rem;
    }
    
    .login-field input {
        height: 44px;
        font-size: 0.9rem;
    }
    
    .login-submit-btn {
        height: 46px;
    }
    
    .login-orb-1 {
        width: 200px;
        height: 200px;
    }
    
    .login-orb-2 {
        width: 150px;
        height: 150px;
    }
    
    .login-orb-3 {
        width: 120px;
        height: 120px;
    }
    
    /* Header mobile - compacto em uma linha */
    .header {
        padding: 10px 12px;
        gap: 8px;
        height: auto;
    }
    
    .logo {
        gap: 6px;
    }
    
    .logo-icon {
        font-size: 1.4rem;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .header-user-info {
        gap: 6px;
    }
    
    .user-badge {
        display: none;
    }
    
    .btn-settings {
        font-size: 0;
        padding: 8px 10px;
    }
    
    .btn-settings::before {
        font-size: 1.1rem;
    }
    
    .btn-install-header {
        font-size: 0;
        padding: 8px 10px;
        min-width: auto;
    }
    
    /* Main layout mobile */
    .main-content {
        flex-direction: column;
        margin-top: 52px;
    }
    
    /* Sidebar mobile - ocupa menos espaço */
    .sidebar {
        position: relative;
        top: 0;
        width: 100%;
        max-height: 38vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
    }
    
    /* Busca compacta */
    .search-container {
        padding: 10px 12px;
    }
    
    #search-input {
        height: 40px;
        font-size: 0.85rem;
        padding: 0 40px 0 14px;
    }
    
    /* Categorias mobile - horizontal scroll */
    .category-tabs {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 0 12px 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .category-tab {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 6px;
        padding: 8px 12px;
        min-width: auto;
    }
    
    .category-tab .cat-icon {
        font-size: 1.1rem;
    }
    
    .category-tab .cat-label {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .category-tab .cat-count {
        font-size: 0.6rem;
        padding: 0 5px;
    }
    
    .category-tab.active::after {
        left: 10%;
        right: 10%;
    }
    
    /* Filtros compactos */
    .filter-tabs {
        padding: 0 12px 8px;
        gap: 6px;
    }
    
    .filter-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* Canais compactos */
    .channel-list {
        padding: 4px 8px;
    }
    
    .channel-item {
        padding: 10px 12px;
        gap: 10px;
        margin-bottom: 4px;
    }
    
    .channel-logo,
    .channel-logo-placeholder {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .channel-name {
        font-size: 0.85rem;
    }
    
    .channel-number {
        font-size: 0.7rem;
    }
    
    .channel-counter {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    /* Player mobile */
    .player-section {
        padding: 10px;
    }
    
    .home-feature {
        min-height: 180px;
    }
    
    .home-feature-title {
        font-size: 1.4rem;
    }
    
    .home-feature-meta {
        font-size: 0.8rem;
    }
    
    .player-container {
        min-height: 220px;
        border-radius: var(--border-radius);
    }
    
    body.channel-selected .player-container {
        min-height: 220px;
    }
    
    .now-playing {
        padding: 10px 12px;
        gap: 10px;
        margin-bottom: 10px;
        border-radius: var(--border-radius);
    }
    
    .now-playing h2 {
        font-size: 0.95rem;
    }
    
    .current-logo {
        width: 40px;
        height: 40px;
        padding: 4px;
    }
    
    .current-info h2::after {
        display: none;
    }
    
    .current-info p {
        font-size: 0.75rem;
    }
    
    /* Controles TV mobile */
    .tv-controls {
        flex-wrap: nowrap;
        padding: 8px;
        gap: 8px;
        margin-top: 10px;
        border-radius: var(--border-radius);
    }
    
    .tv-btn {
        flex: 1;
        min-width: auto;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0;
    }
    
    .tv-btn span {
        font-size: 1.1rem;
    }
    
    /* Settings modal */
    .settings-card {
        width: 95%;
        padding: 20px;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    /* Toast */
    .toast {
        min-width: auto;
        max-width: calc(100vw - 32px);
    }
    
    .toast-container {
        right: 12px;
        left: 12px;
    }
    
    /* Dramio mode mobile */
    body.dramio-mode .sidebar {
        max-height: none;
        height: auto;
        width: 100%;
        min-width: 100%;
    }
    
    body.dramio-mode .category-tabs {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px 12px;
        gap: 6px;
    }
    
    body.dramio-mode .category-tab {
        flex: 0 0 auto;
        flex-direction: row;
        padding: 8px 14px;
        gap: 8px;
    }
    
    body.dramio-mode .player-section {
        padding: 8px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .header {
        padding: 8px 10px;
    }
    
    .logo-icon {
        font-size: 1.2rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .main-content {
        margin-top: 48px;
    }
    
    .sidebar {
        max-height: 35vh;
    }
    
    .search-container {
        padding: 8px 10px;
    }
    
    #search-input {
        height: 36px;
        font-size: 0.8rem;
    }
    
    .category-tab {
        padding: 6px 10px;
    }
    
    .category-tab .cat-label {
        font-size: 0.65rem;
    }
    
    .channel-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .channel-logo,
    .channel-logo-placeholder {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .channel-name {
        font-size: 0.8rem;
    }
    
    .player-section {
        padding: 8px;
    }
    
    .player-container {
        min-height: 200px;
    }
    
    body.channel-selected .player-container {
        min-height: 200px;
    }
    
    .home-feature {
        min-height: 160px;
    }
    
    .home-feature-title {
        font-size: 1.2rem;
    }
    
    .now-playing {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .now-playing h2 {
        font-size: 0.85rem;
    }
    
    .tv-controls {
        padding: 6px;
        gap: 6px;
    }
}


/* ===== TEMA PARA TV ===== */
@media (hover: none) and (pointer: coarse),
       (min-width: 1920px) {
    :root {
        font-size: 18px;
    }
    
    .channel-item {
        padding: 18px 20px;
        margin-bottom: 8px;
    }
    
    .channel-logo,
    .channel-logo-placeholder {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }
    
    .channel-name {
        font-size: 1.1rem;
    }
    
    .tv-btn {
        padding: 18px 36px;
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 18px 36px;
    }
}

/* Foco para navegação TV */
.channel-item:focus,
.btn:focus,
.tv-btn:focus,
.filter-tab:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-primary), var(--shadow-glow);
}

/* Modo tela cheia */
.fullscreen-mode .header,
.fullscreen-mode .sidebar,
.fullscreen-mode .footer,
.fullscreen-mode .tv-controls,
.fullscreen-mode .now-playing {
    display: none;
}

.fullscreen-mode .main-content {
    margin-top: 0;
}

.fullscreen-mode .player-section {
    padding: 0;
}

.fullscreen-mode .player-container {
    border-radius: 0;
    min-height: 100vh;
    border: none;
}


/* ===== ANIMAÇÕES EXTRAS ===== */

/* Efeito glow pulsante no canal ativo */
@keyframes active-glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
    50% {
        box-shadow: 0 0 35px var(--accent-glow);
    }
}

.channel-item.active {
    animation: active-glow 3s ease-in-out infinite;
}

/* Skeleton loading premium */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

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

/* Efeito de entrada para cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.channel-item {
    animation: fadeInUp 0.3s ease backwards;
}

.channel-item:nth-child(1) { animation-delay: 0.02s; }
.channel-item:nth-child(2) { animation-delay: 0.04s; }
.channel-item:nth-child(3) { animation-delay: 0.06s; }
.channel-item:nth-child(4) { animation-delay: 0.08s; }
.channel-item:nth-child(5) { animation-delay: 0.10s; }
.channel-item:nth-child(6) { animation-delay: 0.12s; }
.channel-item:nth-child(7) { animation-delay: 0.14s; }
.channel-item:nth-child(8) { animation-delay: 0.16s; }
.channel-item:nth-child(9) { animation-delay: 0.18s; }
.channel-item:nth-child(10) { animation-delay: 0.20s; }


/* ===== EFEITOS EXTRAS PREMIUM ===== */

/* Partículas de fundo (decorativo) */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Efeito de reflexo no player */
.player-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 100%
    );
    pointer-events: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

/* Hover nos botões de controle TV */
.tv-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
    border-radius: inherit;
    z-index: -1;
}

.tv-btn:hover::after {
    opacity: 0.1;
}

/* Badge de qualidade (para futuro EPG) */
.quality-badge {
    padding: 2px 6px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.quality-badge.hd {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.quality-badge.fhd {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.quality-badge.uhd {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ===== TV DASHBOARD LAYOUT (REFERENCIA VISUAL) ===== */
body {
    background:
    linear-gradient(180deg, rgba(1, 10, 3, 0.68), rgba(1, 10, 3, 0.82)),
    url('assets/bachgroud.png') center/cover no-repeat fixed,
        radial-gradient(circle at 10% 0%, rgba(14, 38, 97, 0.45), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(6, 33, 84, 0.4), transparent 42%),
        #020812;
}

.app-container::before {
    display: none;
}

.header {
    position: static;
    height: auto;
    padding: 14px 20px 6px;
    border: 0;
    background: transparent;
    justify-content: center;
}

.logo {
    width: 210px;
    height: 90px;
    background: url('assets/512.png') center/contain no-repeat;
}

.logo-icon {
    display: none;
}

.logo h1 {
    display: none;
}

.header-user-info {
    display: none;
}

.main-content {
    margin-top: 0;
    min-height: auto;
    width: min(1240px, 96vw);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
    border-radius: 12px;
    padding: 22px;
    gap: 20px;
    background:
        linear-gradient(145deg, rgba(9, 14, 35, 0.97), rgba(4, 10, 26, 0.92));
    border: 1px solid rgba(126, 160, 210, 0.2);
    box-shadow: 0 24px 48px rgba(2, 8, 24, 0.55);
}

.sidebar {
    width: 58%;
    min-width: 58%;
    height: auto;
    position: relative;
    top: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    padding-top: 14px;
}

.search-container,
.filter-tabs,
.channel-list,
.channel-counter {
    display: none;
}

.category-tabs {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    grid-auto-rows: 112px;
    gap: 10px;
    padding: 0;
}

.category-tab {
    background: #2a3042;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    justify-content: center;
    gap: 8px;
    color: rgba(238, 245, 255, 0.88);
}

.category-tab .cat-icon {
    font-size: 1.7rem;
}

.category-tab .cat-label {
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.category-tab .cat-count,
.category-tab.active::after {
    display: none;
}

.category-tab.active,
.category-tab:hover {
    background: #39445f;
    border-color: rgba(129, 170, 230, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.category-tab:nth-child(2) {
    grid-row: span 2;
}

.category-tab:nth-child(2) .cat-icon {
    font-size: 2.3rem;
}

.category-tab:nth-child(2) .cat-label {
    font-size: 1.2rem;
}

.player-section {
    padding: 0;
    background: transparent;
    min-height: 340px;
}

.home-feature {
    position: relative;
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    min-height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(2, 12, 6, 0.22), rgba(1, 8, 3, 0.86)),
        url('assets/bachgroud.png') center/cover no-repeat;
}

.home-feature-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 80%);
}

.home-feature-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
    margin-bottom: 8px;
}

.home-feature-title {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 4px;
}

.home-feature-meta {
    color: rgba(235, 244, 255, 0.82);
    font-size: 0.92rem;
}

.now-playing,
.player-container {
    display: none;
}

body.channel-selected .home-feature {
    display: none;
}

body.channel-selected .now-playing,
body.channel-selected .player-container {
    display: flex;
}

body.channel-selected .player-container {
    min-height: 320px;
}

.tv-controls {
    margin-top: 10px;
    justify-content: flex-end;
    padding: 0;
    border: 0;
    background: transparent;
}

.tv-btn {
    background: #2c3347;
    border-radius: 8px;
    min-width: 54px;
    min-height: 46px;
    padding: 0 18px;
    font-size: 0;
}

.tv-btn span {
    font-size: 1.2rem;
}

.footer {
    height: auto;
    border: 0;
    background: transparent;
    color: #e9f2ff;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding-bottom: 14px;
}

@media (max-width: 960px) {
    .main-content {
        width: min(100%, 98vw);
        flex-direction: column;
        padding: 10px;
    }

    .sidebar,
    .player-section {
        width: 100%;
        min-width: 100%;
    }

    .category-tabs {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .category-tab {
        flex: 0 0 auto;
    }

    .category-tab:nth-child(2) {
        grid-row: span 1;
    }

    .home-feature {
        min-height: 220px;
    }
}

.main-content.grid-mode .search-container {
    display: block;
}

.main-content.grid-mode .filter-tabs {
    display: flex;
}

.main-content.grid-mode .channel-list {
    display: block;
}

.main-content.grid-mode .channel-counter {
    display: block;
}

/* ===== MODO DORAMA (LAYOUT ANTIGO) ===== */
body.dramio-mode .header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    justify-content: space-between;
}

body.dramio-mode .logo-icon {
    display: block;
}

body.dramio-mode .logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-transform: none;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dramio-mode .header-user-info {
    display: flex;
}

body.dramio-mode .main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: auto;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 0;
    padding: 0;
    gap: 0;
    background: var(--bg-primary);
    border: 0;
    box-shadow: none;
}

body.dramio-mode .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-glass);
    border-right: 1px solid var(--border-color);
    display: flex;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    padding-top: 0;
}

body.dramio-mode .search-container,
body.dramio-mode .filter-tabs,
body.dramio-mode .channel-list,
body.dramio-mode .channel-counter {
    display: none;
}

body.dramio-mode .category-tabs {
    grid-template-columns: repeat(1, 1fr);
    grid-auto-rows: minmax(62px, auto);
    gap: 10px;
    padding: 18px;
}

body.dramio-mode .category-tab {
    flex-direction: row;
    justify-content: flex-start;
    padding: 14px;
    gap: 12px;
}

body.dramio-mode .category-tab:nth-child(2) {
    grid-row: span 1;
}

body.dramio-mode .category-tab .cat-count {
    display: inline-block;
    margin-left: auto;
}

body.dramio-mode .player-section {
    padding: 18px;
    background: var(--bg-primary);
    min-height: calc(100vh - var(--header-height));
}

body.dramio-mode .home-feature,
body.dramio-mode .now-playing,
body.dramio-mode .player-container,
body.dramio-mode .tv-controls {
    display: none !important;
}

body.dramio-mode .dramio-container {
    display: flex !important;
    min-height: calc(100vh - var(--header-height) - 36px);
}

body.dramio-mode .dramio-carousel {
    height: 460px;
}

@media (max-width: 1024px) {
    body.dramio-mode .dramio-carousel {
        height: 360px;
    }
}

@media (max-width: 768px) {
    body.dramio-mode .dramio-carousel {
        height: 240px;
    }
}
