:root {
    /* Paleta Tema Cavalo */
    --bg-darkest: #070504;
    --bg-surface: #120c08;
    --bg-elevated: #1e140d;
    --accent-bronze: #d97724;
    --accent-copper: #e88d43;
    --accent-gold: #f2aa4c;
    --glow-bronze: rgba(217, 119, 36, 0.4);
    
    /* Texto */
    --text-primary: #fdfbf7;
    --text-secondary: #a89f96;
    --text-tertiary: #6b635c;
    
    /* Tipografia */
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: var(--bg-darkest);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    /* Fundo com gradiente radial subtil para dar profundidade */
    background-image: radial-gradient(circle at top right, rgba(217, 119, 36, 0.05), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(232, 141, 67, 0.03), transparent 40%);
}

/* =========================================================
   SISTEMA DE LOGIN
   ========================================================= */
#login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 5, 4, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.login-container {
    background: linear-gradient(145deg, var(--bg-surface), #0a0705);
    border: 1px solid rgba(217, 119, 36, 0.15);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.logo-wrapper { text-align: center; margin-bottom: 40px; }

.brand-logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-copper);
    letter-spacing: 2px;
    text-shadow: 0 0 20px var(--glow-bronze);
}

.brand-logo span { color: var(--text-primary); }

.brand-sub {
    font-size: 0.85rem;
    color: var(--accent-bronze);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 5px;
    font-weight: 600;
}

.input-group { margin-bottom: 24px; }

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    background: var(--bg-darkest);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-bronze);
    box-shadow: 0 0 0 4px rgba(217, 119, 36, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-bronze), var(--accent-copper));
    border: none;
    border-radius: 12px;
    color: var(--bg-darkest);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-primary span { position: relative; z-index: 2; }

.error-text {
    color: #ff4b4b;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 16px;
    font-weight: 500;
    display: none;
}

/* =========================================================
   DASHBOARD / APP PRINCIPAL
   ========================================================= */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-nav {
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid rgba(217, 119, 36, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-copper);
    letter-spacing: 1px;
}
.nav-brand span { color: var(--text-primary); }

.nav-user { display: flex; align-items: center; gap: 24px; }

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(217, 119, 36, 0.3);
    color: var(--accent-bronze);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(217, 119, 36, 0.1);
    border-color: var(--accent-copper);
    color: var(--accent-gold);
}

/* =========================================================
   LAYOUT DO CONTEÚDO (GRID)
   ========================================================= */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px;
    height: calc(100vh - 70px);
}

/* Reprodutor de Vídeo */
.player-container {
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.video-wrapper {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-tertiary);
    z-index: 1;
}

.now-playing-bar {
    height: 85px;
    background: linear-gradient(to right, var(--bg-elevated), var(--bg-surface));
    border-top: 1px solid rgba(217, 119, 36, 0.15);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
}

#current-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 4px;
}

.now-playing-info h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.now-playing-info span {
    font-size: 0.85rem;
    color: var(--accent-bronze);
    font-weight: 500;
}

/* Sidebar de Canais */
.sidebar {
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

.search-input-wrapper input {
    width: 100%;
    background: var(--bg-darkest);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 12px 12px 42px;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-bronze);
}

.channel-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Cartões de Canal */
.channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.channel-card:hover {
    background: rgba(217, 119, 36, 0.05);
    border-color: rgba(217, 119, 36, 0.2);
}

.channel-card.active {
    background: rgba(217, 119, 36, 0.1);
    border-color: var(--accent-bronze);
    box-shadow: 0 0 15px rgba(217, 119, 36, 0.1);
}

.channel-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: var(--bg-darkest);
    border-radius: 8px;
    padding: 4px;
}

.channel-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.channel-group {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.loading-msg {
    text-align: center;
    color: var(--accent-bronze);
    padding: 20px;
    font-weight: 500;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(217, 119, 36, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-bronze); }