@font-face {
  font-family: "Euclid Circular A";
  src:
    url("fonts/EuclidCircularA-Light-WebS.woff2") format("woff2"),
    url("fonts/EuclidCircularA-Light-WebS.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src:
    url("fonts/EuclidCircularA-Regular-WebS.woff2") format("woff2"),
    url("fonts/EuclidCircularA-Regular-WebS.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src:
    url("fonts/EuclidCircularA-Medium-WebS.woff2") format("woff2"),
    url("fonts/EuclidCircularA-Medium-WebS.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src:
    url("fonts/EuclidCircularA-Bold-WebS.woff2") format("woff2"),
    url("fonts/EuclidCircularA-Bold-WebS.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #006eab;
  --primary-dark: #005a8d;
  --primary-light: #e8f4fa;
  --surface: #ffffff;
  --surface-dim: #f5f7f9;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 8px;
  --radius-sm: 4px;
}

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

body {
  font-family:
    "Euclid Circular A",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
}

.container {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Main layout - map and sidebar side by side */
.main-layout {
  display: flex;
  flex-direction: row;
}

/* Map container */
.canvas-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0a0a;
  overflow: hidden;
  width: min(900px, calc(100vw - 320px));
  height: min(900px, calc(100vw - 320px));
}

#worldMap {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#mapCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

/* Sidebar */
.sidebar {
  width: 300px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

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

.sidebar-section:last-child {
  border-bottom: none;
}

/* Control groups */
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 50px;
}

.control-group select {
  flex: 1;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.control-group select:hover {
  border-color: var(--primary);
}

.control-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.control-group input[type="range"] {
  flex: 1;
  min-width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.control-group span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.control-group.compact {
  gap: 6px;
  margin-bottom: 8px;
}

.control-group.compact label {
  font-size: 12px;
  min-width: 55px;
}

.control-group.compact span {
  font-size: 11px;
  min-width: 38px;
  flex-shrink: 0;
}

/* Playback controls */
.playback-controls {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-row {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-icon:hover {
  background: var(--primary-dark);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-icon.btn-ghost:hover {
  background: var(--border);
  color: var(--text);
}

/* Play/pause button states */
#playPauseBtn .icon-play {
  display: none;
}

#playPauseBtn.paused .icon-pause {
  display: none;
}

#playPauseBtn.paused .icon-play {
  display: block;
}

.btn-secondary {
  flex: 1;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.btn-secondary:hover {
  background: var(--surface-dim);
  border-color: var(--text-muted);
}

.btn-secondary:active {
  transform: scale(0.98);
}

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

.btn-small {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-small:hover {
  background: var(--surface-dim);
}

/* Settings dropdown header */
.settings-section {
  padding: 0;
  border-bottom: none;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  text-align: left;
}

.settings-header:hover {
  background: var(--surface-dim);
  color: var(--text);
}

.settings-header .chevron {
  transition: transform 0.2s ease;
}

.settings-header.active .chevron {
  transform: rotate(180deg);
}

/* Status display */
.status-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
  padding: 8px 12px;
  background: var(--surface-dim);
  border-radius: var(--radius-sm);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-separator {
  opacity: 0.4;
}

.record-indicator {
  display: none;
}

.record-indicator.active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #dc2626;
  font-weight: 600;
}

.record-indicator.active::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

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

/* Settings panel */
.settings-panel {
  background: var(--surface-dim);
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.settings-panel[hidden] {
  display: none;
}

.settings-group {
  margin-bottom: 16px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Toggle controls */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-top: 8px;
}

.toggle-control input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}

.toggle-control span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
  }

  .canvas-container {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 70vh;
  }

  .sidebar {
    width: 100%;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .sidebar-section {
    padding: 12px 16px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .container {
    border-radius: 8px;
  }

  .btn-row {
    flex-wrap: wrap;
  }

  .btn-secondary {
    flex: 1 1 auto;
    min-width: 70px;
  }
}
