:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-panel: #111827;
  --border-color: #334155;
  --primary: #10a37f;
  --primary-hover: #0d8a6b;
  --accent: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, #10a37f, #06b6d4);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.tag-client {
  background: rgba(16, 163, 127, 0.15);
  color: #10a37f;
  border: 1px solid rgba(16, 163, 127, 0.4);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* Main Studio Layout */
.studio-container {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr 340px;
  gap: 16px;
  padding: 16px;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

.panel {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Controls & Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-box {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.input-box:focus {
  border-color: var(--primary);
}

.dropzone {
  border: 2px dashed var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.dropzone:hover {
  border-color: var(--primary);
  background: rgba(16, 163, 127, 0.05);
}

.dropzone p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Ratio selector */
.ratio-tabs {
  display: flex;
  gap: 8px;
}

.ratio-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.ratio-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Center Stage (Canvas Player) */
.stage-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-panel);
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.canvas-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

#renderCanvas {
  max-width: 100%;
  max-height: 65vh;
  display: block;
  object-fit: contain;
}

.stage-controls {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

/* Action Buttons */
.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #10a37f, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 163, 127, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 163, 127, 0.5);
}

.btn-secondary {
  background: #334155;
  color: #fff;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-drive {
  background: #2563eb;
  color: #fff;
}

.btn-drive:hover {
  background: #1d4ed8;
}

/* Scene List Items */
.scene-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scene-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.scene-card:hover, .scene-card.active {
  border-color: var(--accent);
}

.scene-thumb {
  width: 64px;
  height: 44px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: #334155;
  flex-shrink: 0;
}

.scene-info {
  flex: 1;
  overflow: hidden;
}

.scene-time {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.scene-text {
  font-size: 12px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress modal */
.progress-container {
  display: none;
  background: rgba(0, 0, 0, 0.85);
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
}

.progress-bar-bg {
  width: 80%;
  height: 12px;
  background: #334155;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10a37f, #f59e0b);
  transition: width 0.1s linear;
}

.badge-pro {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Scene Inspector Panel */
.inspector-panel {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inspector-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inspector-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-upload-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed var(--border-color);
  color: #e2e8f0;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-upload-sm:hover {
  background: rgba(16, 163, 127, 0.15);
  border-color: var(--primary);
  color: #fff;
}

.custom-tag {
  background: #0284c7;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
