:root {
    --bg: #030406;
    --surface: #0f1116;
    --surface-bright: #161922;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.2); /* Sharper high-contrast borders */
    --danger: #ef4444;
}

[x-cloak] { display: none !important; }

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Side Drawer Styling */
.side-drawer {
    position: fixed;
    top: 0; right: -360px; width: 360px; height: 100vh;
    background: #08090c; 
    border-left: 2px solid var(--border);
    z-index: 2000; 
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.8);
}
.side-drawer.open { right: 0; }

.config-header { border-bottom: 1px solid var(--border); }

.config-label {
    display: block; font-size: 11px; text-transform: uppercase; 
    color: var(--accent); margin-bottom: 8px; letter-spacing: 1.5px; font-weight: 800;
}

.config-field {
    width: 100%; background: #000; border: 1px solid var(--border);
    border-radius: 12px; color: #fff; padding: 14px; font-size: 0.85rem;
    transition: all 0.2s;
}
.config-field:focus { border-color: var(--accent); outline: none; background: #050505; }

/* Main Navigation */
.top-nav {
    height: 85px;
    background: rgba(3, 4, 6, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
}

.command-center {
    display: flex; align-items: center; background: var(--surface);
    border-radius: 18px; padding: 6px 8px 6px 18px; width: 100%; max-width: 600px;
    border: 1px solid var(--border); transition: all 0.3s;
}
.command-center:focus-within {
    border-color: var(--accent);
    background: var(--surface-bright);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}
.command-center input {
    background: transparent; border: none; color: #fff;
    flex-grow: 1; padding: 10px; font-size: 0.95rem; outline: none;
}
.command-center input::placeholder { color: #475569; }

.btn-action-primary {
    background: var(--accent); color: white; border: none;
    padding: 10px 24px; border-radius: 14px; font-weight: 700;
    font-size: 0.9rem; transition: background 0.2s;
}
.btn-action-primary:hover { background: var(--accent-hover); }

/* Player Experience */
.player-viewport {
    background: #000; border-radius: 32px; overflow: hidden;
    position: relative; aspect-ratio: 16/9; border: 2px solid var(--border);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.7);
}
video { width: 100%; height: 100%; object-fit: contain; }

.rec-tag {
    position: absolute; top: 25px; left: 25px; background: var(--danger);
    padding: 6px 16px; border-radius: 10px; font-size: 0.75rem; font-weight: 800;
    color: white; border: 1px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; gap: 8px; z-index: 10;
}

/* Sidebar Content */
.content-card {
    background: var(--surface); border-radius: 32px; padding: 28px;
    border: 2px solid var(--border); height: calc(100vh - 150px);
    display: flex; flex-direction: column;
}

.ep-list { flex-grow: 1; overflow-y: auto; padding-right: 12px; margin-top: 15px; }
.ep-card {
    display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 20px;
    cursor: pointer; margin-bottom: 12px; transition: all 0.2s;
    border: 1px solid transparent; background: rgba(255,255,255,0.02);
}
.ep-card:hover { background: rgba(255,255,255,0.06); border-color: var(--border); }
.ep-card.active { 
    background: rgba(99, 102, 241, 0.15); 
    border-color: var(--accent); 
}

.ep-index {
    width: 48px; height: 48px; background: var(--surface-bright);
    border-radius: 14px; color: var(--accent); font-size: 0.9rem; font-weight: 800;
    border: 1px solid var(--border); flex-shrink: 0;
}
.ep-card.active .ep-index { background: var(--accent); color: white; border-color: var(--accent); }

.ep-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.ep-id { font-size: 0.75rem; color: var(--text-secondary); font-family: monospace; }

/* Buttons & Icons */
.btn-ghost {
    background: var(--surface); border: 2px solid var(--border);
    color: white; border-radius: 16px; padding: 12px 20px;
    font-weight: 700; transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface-bright); border-color: var(--text-secondary); }

.btn-circle {
    width: 45px; height: 45px; border-radius: 15px; border: 1px solid var(--border);
    background: var(--surface); color: white; display: flex; align-items: center; justify-content: center;
}

/* Utilities */
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 991px) {
    .content-card { height: auto; min-height: 400px; }
    .side-drawer { width: 100%; right: -100%; }
}