/* ═══════════════════════════════════════════════════════════════
   Coliseum Operator — Ancient Rome Theme
   Gold, bronze, marble & terracotta
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Crimson+Pro:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0d0b08;
  --bg-secondary: #161210;
  --bg-card: rgba(22, 18, 14, 0.85);
  --bg-input: rgba(12, 10, 7, 0.8);
  --border-color: rgba(160, 130, 80, 0.15);
  --border-color-hover: rgba(190, 155, 95, 0.3);
  --text-primary: #e8dcc8;
  --text-secondary: #b8a88c;
  --text-muted: #7a6b55;
  --accent-primary: #c9a84c;
  --accent-primary-light: #dbbe68;
  --accent-primary-glow: rgba(201, 168, 76, 0.25);
  --accent-success: #7a9e5a;
  --accent-danger: #a63d2f;
  --accent-warning: #c4853a;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

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

html, body {
  height: 100%;
  font-family: 'Crimson Pro', 'Georgia', serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Subtle stone texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 80px,
      rgba(201, 168, 76, 0.01) 80px,
      rgba(201, 168, 76, 0.01) 82px
    ),
    linear-gradient(180deg, rgba(201, 168, 76, 0.03) 0%, transparent 30%, transparent 70%, rgba(201, 168, 76, 0.02) 100%);
  pointer-events: none;
}

h1, h2, h3, .login-title, .ws-logo {
  font-family: 'Cinzel', 'Times New Roman', serif;
}

/* ── Login Screen ───────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-top: 2px solid var(--accent-primary);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

.login-icon { font-size: 56px; margin-bottom: 16px; }

.login-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 5px;
  margin-bottom: 4px;
  color: var(--accent-primary);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.code-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.code-char {
  width: 48px;
  height: 56px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  transition: all var(--transition-fast);
}

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

.login-error {
  background: rgba(166, 61, 47, 0.12);
  border: 1px solid rgba(166, 61, 47, 0.3);
  border-radius: var(--radius-sm);
  color: #d4715e;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  animation: shake 0.4s ease;
}

.login-error.show { display: block; }

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-primary), #8B6914);
  color: #0d0b08;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 1px;
}

.login-btn:hover {
  box-shadow: 0 4px 16px var(--accent-primary-glow);
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Workspace Layout ───────────────────────────────────────── */
.workspace {
  display: none;
  height: 100vh;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.workspace.active {
  display: flex;
}

/* Header */
.ws-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(10, 8, 5, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  gap: 16px;
  flex-shrink: 0;
}

.ws-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 15px;
  color: var(--accent-primary);
}

.ws-logo-icon { font-size: 22px; }

.ws-device-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.ws-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  animation: pulse-dot 2s infinite;
}

.ws-status-dot.offline {
  background: var(--text-muted);
  animation: none;
}

.ws-device-name { font-weight: 600; color: var(--text-primary); }

.ws-metrics {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.ws-metric-value { color: var(--text-secondary); font-weight: 500; }

/* Main workspace area */
.ws-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Phone screen panel — LEFT, narrow */
.ws-screen-panel {
  width: 320px;
  min-width: 260px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  background: rgba(8, 6, 4, 0.5);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
}

.screen-container {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.phone-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(201, 168, 76, 0.2);
  cursor: pointer;
  touch-action: none;
  object-fit: contain;
}

.screen-placeholder {
  text-align: center;
  padding: 20px;
}

.screen-placeholder-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.screen-placeholder-text {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
}
.screen-placeholder-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; opacity: 0.7; }

/* Phone controls */
.phone-controls {
  display: flex;
  gap: 6px;
  padding: 8px 0 4px;
  justify-content: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.phone-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.phone-btn:hover {
  background: rgba(201, 168, 76, 0.12);
  color: var(--accent-primary);
  border-color: rgba(201, 168, 76, 0.3);
}

.phone-btn:active {
  transform: scale(0.92);
}

.phone-btn-sep {
  width: 1px;
  background: var(--border-color);
  margin: 0 2px;
}

/* Resize handle */
.ws-resize {
  width: 6px;
  background: transparent;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.ws-resize:hover {
  background: rgba(201, 168, 76, 0.15);
}

.ws-resize-line {
  width: 2px;
  height: 40px;
  background: var(--border-color);
  border-radius: 1px;
}

/* VDO.ninja panel — RIGHT, wide (takes all remaining space) */
.ws-vdo-panel {
  flex: 1;
  background: #000;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vdo-panel-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
  background: rgba(10, 8, 5, 0.9);
  flex-shrink: 0;
}

.audio-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(122, 158, 90, 0.15);
  color: var(--accent-success);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

.audio-status-badge.disconnected {
  background: rgba(160, 130, 80, 0.1);
  color: var(--text-muted);
}

.vdo-volume-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vdo-iframe-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

.vdo-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.control-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.volume-slider {
  width: 100px;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
}

.volume-value {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  min-width: 32px;
  text-align: right;
}

/* ── Status Bar ─────────────────────────────────────────────── */
.ws-statusbar {
  display: flex;
  padding: 4px 16px;
  background: rgba(10, 8, 5, 0.95);
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  gap: 20px;
  flex-shrink: 0;
}

.ws-statusbar-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-statusbar-label { opacity: 0.7; }
.ws-statusbar-value { color: var(--text-secondary); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

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

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

.loading-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(160, 130, 80, 0.2); border-radius: 3px; }
