/* ShotClipper Panel - Dark Theme */
:root {
    --bg-0: #0a0a0a;
    --bg-1: #141414;
    --bg-2: #1e1e1e;
    --bg-3: #2a2a2a;
    --border: #333;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --accent-blue: #4a9eff;
    --accent-green: #4CAF50;
    --accent-red: #f44336;
    --accent-orange: #ff9800;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-0);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 220px;
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-blue);
}

.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-2); }
.nav-link.active { color: var(--accent-blue); background: var(--bg-2); border-left: 3px solid var(--accent-blue); }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Main content */
#content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: 100vh;
}

#page-container { max-width: 1200px; }

/* Cards */
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Grid layouts */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Stat boxes */
.stat-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-box .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-box .value {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-2);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover { background: var(--bg-3); }
.btn-primary { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-danger { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-2);
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 12px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

th {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover td { background: var(--bg-2); }

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.live { background: var(--accent-green); }
.status-dot.offline { background: var(--accent-red); }
.status-dot.waiting { background: var(--accent-orange); }

/* Stream viewer */
.stream-container {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.stream-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Clip grid */
.clip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.clip-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
}

.clip-card:hover { border-color: var(--accent-blue); }

.clip-card .preview {
    aspect-ratio: 16/9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.clip-card .info {
    padding: 12px;
}

.clip-card .info .name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-card .info .meta {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Login overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.hidden { display: none; }

.login-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    width: 360px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--accent-blue);
}

.error {
    color: var(--accent-red);
    font-size: 13px;
    margin-top: 8px;
}

.register-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.register-link a { color: var(--accent-blue); }

/* Responsive */
@media (max-width: 768px) {
    body { flex-direction: column; }
    #sidebar { width: 100%; flex-direction: row; }
    .nav-links { display: flex; padding: 0; overflow-x: auto; }
    .nav-link { padding: 12px 16px; white-space: nowrap; }
    .sidebar-header, .sidebar-footer { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden { display: none; }

.modal-content {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 { margin-bottom: 16px; }

/* Video player */
.video-player {
    width: 100%;
    max-height: 60vh;
    background: #000;
    border-radius: var(--radius);
}

/* Timer */
.timer {
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-green { background: rgba(76,175,80,0.2); color: var(--accent-green); }
.badge-red { background: rgba(244,67,54,0.2); color: var(--accent-red); }
.badge-blue { background: rgba(74,158,255,0.2); color: var(--accent-blue); }
.badge-orange { background: rgba(255,152,0,0.2); color: var(--accent-orange); }
