/* ─── ScreenCast Dark Theme ─────────────────────────────────────────────── */
:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-hover: #252525;
  --border: #333;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #4fc3f7;
  --accent-hover: #29b6f6;
  --danger: #ef5350;
  --video: #66bb6a;
  --audio: #ffa726;
  --image: #ce93d8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.header nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.header nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.header nav a:hover,
.header nav a.active {
  color: var(--text);
  background: var(--surface-hover);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
}

.status-dot.live {
  background: #66bb6a;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Main Layout ────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ─── Dashboard Cards ────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--accent);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ─── Live Stream Player ─────────────────────────────────────────────────── */
.player-wrapper {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.player-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-muted);
  font-size: 14px;
}

.player-overlay.hidden { display: none; }

.live-badge {
  background: #ef5350;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── File Browser ───────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  font-size: 14px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

.file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.file-item:hover {
  background: var(--surface-hover);
}

.file-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.file-icon.dir { background: #1e3a5f; color: var(--accent); }
.file-icon.video { background: #1b3d1b; color: var(--video); }
.file-icon.audio { background: #3d2e1b; color: var(--audio); }
.file-icon.image { background: #3d1b3d; color: var(--image); }

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  gap: 8px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: #000;
}

/* ─── Drive Selector ─────────────────────────────────────────────────────── */
.drive-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.drive-btn {
  padding: 10px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.drive-btn:hover, .drive-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Media Player Page ──────────────────────────────────────────────────── */
.media-player {
  max-width: 900px;
  margin: 0 auto;
}

.media-player video,
.media-player audio {
  width: 100%;
  border-radius: 8px;
  background: #000;
}

.media-player-info {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.media-player-info h2 {
  font-size: 18px;
  font-weight: 600;
  word-break: break-all;
}

/* ─── Loading / Empty States ─────────────────────────────────────────────── */
.loading, .empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .container { padding: 16px; }
  .header { padding: 10px 16px; }
}
