/* styles.css - AeroTrack Telemetry Studio (GPX x WebGL 3D Fly-Through & Video Telemetry Recorder) */
:root {
  --bg-dark: #050811;
  --panel-bg: rgba(11, 16, 28, 0.96);
  --panel-border: rgba(255, 255, 255, 0.10);
  --card-bg: rgba(20, 29, 48, 0.76);
  --accent-cyan: #00e5ff;
  --accent-orange: #ff5500;
  --accent-emerald: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Meiryo", sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 58px;
  background: rgba(5, 8, 17, 0.98);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00e5ff, #ff5500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.45);
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.16);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 190px;
  max-width: 460px;
}

.select-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  outline: none;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-box option {
  background: #0f172a;
  color: #fff;
}

.btn {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-record {
  background: linear-gradient(135deg, #ef4444, #ff5500);
  color: #fff;
  border-color: rgba(255, 100, 100, 0.5);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.btn-record.recording {
  animation: pulseRec 1s infinite alternate;
}

@keyframes pulseRec {
  from { box-shadow: 0 0 8px #ef4444; }
  to { box-shadow: 0 0 24px #ff0000; }
}

.btn-cyan {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.45);
  color: #7df9ff;
}

.btn-mp4 {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* Main Workspace */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 380px;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  padding: 13px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 800;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.upload-box {
  border: 1.5px dashed rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.05);
  border-radius: 9px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
  transition: all 0.15s;
}

.upload-box:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--accent-cyan);
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.cam-btn {
  padding: 8px 6px;
  border-radius: 7px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.cam-btn.active {
  background: rgba(0, 229, 255, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
}

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

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #cbd5e1;
}

.val-badge {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #cbd5e1;
  cursor: pointer;
}

/* Main Video & 3D Master Stage */
.stage-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #03050a;
  position: relative;
}

.stage-wrap.dragover {
  outline: 2px dashed var(--accent-cyan);
  outline-offset: -8px;
}

.viewport-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

#masterCanvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  background: #060b16;
  cursor: grab;
}

/* Bottom Timeline Transport Bar */
.timeline-bar {
  height: 62px;
  background: rgba(9, 13, 24, 0.98);
  border-top: 1px solid var(--panel-border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e5ff, #0284c7);
  border: none;
  color: #021019;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-slider-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-toast {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #e0f2fe;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  display: none;
}

.status-toast.visible {
  display: block;
}
