@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #000000;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-medium: rgba(255, 255, 255, 0.20);
  --border-strong: rgba(255, 255, 255, 0.30);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.70);
  --text-muted: rgba(255, 255, 255, 0.50);
  --text-dim: rgba(255, 255, 255, 0.40);
  --accent: #facc15;
  --accent-hover: #fde047;
  --success: #6ee7b7;
  --danger: #fca5a5;
  --warning: #fde047;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Header - Scout style */
.header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.header-brand {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 640px;
}

/* Tab navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 9999px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* Cards - Scout style */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
}

.card + .card {
  margin-top: 16px;
}

.card h3 {
  margin: 0 0 16px 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.card h4 {
  margin: 16px 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Layout */
.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.col {
  flex: 1 1 280px;
}

/* Buttons - Scout style */
.btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-medium);
  padding: 12px 24px;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}

.btn-outline:hover {
  border-color: var(--border-strong);
}

.btn-small {
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}

.btn-small:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Toggles - Scout pill style */
.toggle-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.toggle {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.toggle:hover {
  border-color: var(--border-medium);
  color: var(--text);
}

.toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* YouTube-style layout: video left, shots right */
.results-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.video-column {
  flex: 0 0 58%;
  max-width: 58%;
  position: sticky;
  top: 20px;
}

.shots-column {
  flex: 1;
  min-width: 0;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 4px;
}

.shots-column::-webkit-scrollbar {
  width: 4px;
}
.shots-column::-webkit-scrollbar-track {
  background: transparent;
}
.shots-column::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.shots-column::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@media (max-width: 900px) {
  .results-layout {
    flex-direction: column;
  }
  .video-column {
    flex: none;
    max-width: 100%;
    position: static;
  }
  .shots-column {
    max-height: none;
    overflow-y: visible;
  }
}

/* Video */
.video-panel {
  padding: 16px;
}

.video-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* Timeline */
.timeline-container {
  margin-top: 16px;
  padding: 12px 0;
}

.timeline-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-track {
  position: relative;
  height: 32px;
  background: var(--surface);
  border-radius: 9999px;
  border: 1px solid var(--border);
  overflow: visible;
}

.timeline-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 5;
  pointer-events: none;
}

.timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  z-index: 10;
  border: 2px solid white;
}

.timeline-marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

.marker-label {
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.timeline-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Summary Card */
.summary-card {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.summary-grade {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
}

.summary-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
}

.score-label {
  font-size: 16px;
  color: var(--text-muted);
}

.summary-stats {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Coach Summary */
.coach-summary {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.coach-summary p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Shot Cards */
.shots-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shot-card:hover {
  background: var(--surface-hover);
}

.shot-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.shot-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.shot-id {
  font-weight: 600;
  font-size: 14px;
}

.shot-time {
  font-size: 13px;
  color: var(--text-muted);
}

.shot-grade {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.shot-direction {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 4px 12px;
  background: var(--surface);
  border-radius: 9999px;
  border: 1px solid var(--border);
  display: inline-block;
}

.shot-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.metric-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-question {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-answer {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.shot-notes {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.shot-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Progress */
.progress-wrap {
  margin-top: 12px;
}

.progress-track {
  height: 6px;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: 9999px;
}

.progress-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Error message */
.error-message {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(252, 165, 165, 0.08);
  border: 1px solid var(--danger);
  border-radius: 16px;
  color: var(--danger);
  font-size: 13px;
}

/* Upload */
.upload-label {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: var(--accent);
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  border: 2px dashed var(--border-medium);
  border-radius: 24px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--accent);
  background: rgba(250, 204, 21, 0.04);
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-text {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Video preview after selection */
.video-preview-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.video-thumbnail {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.video-preview-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.video-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.change-video-btn {
  font-size: 12px;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 9999px;
  color: var(--text-muted);
  cursor: pointer;
  width: fit-content;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.change-video-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Net Confirmation */
.net-confirm-panel h3 {
  margin-bottom: 8px;
}

.net-confirm-panel p {
  margin-bottom: 16px;
}

.canvas-container {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.net-canvas {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  cursor: crosshair;
}

.net-confirm-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Wall Ball Counter */
.wallball-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wallball-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
}

.wallball-count {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
}

.wallball-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.wallball-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.wallball-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.wallball-metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.wallball-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.wallball-notes {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
}

/* Grade badges */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  border: 2px solid;
}

.grade-elite {
  color: var(--success);
  border-color: var(--success);
  background: rgba(110, 231, 183, 0.1);
}

.grade-good {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(250, 204, 21, 0.1);
}

.grade-needs-work {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(252, 165, 165, 0.1);
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .container {
    padding: 24px 16px 60px;
  }

  .title {
    font-size: 28px;
  }

  .header {
    margin-bottom: 24px;
  }

  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .summary-grade {
    font-size: 48px;
  }

  .summary-stats {
    margin-left: 0;
    width: 100%;
    justify-content: space-around;
  }

  .shot-card {
    border-radius: 16px;
  }

  .toggle-group {
    flex-wrap: wrap;
  }

  .toggle {
    flex: 1 1 auto;
    text-align: center;
    min-width: 80px;
  }

  .shot-actions {
    flex-direction: column;
  }

  .btn-small {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .row {
    flex-direction: column;
  }

  .col {
    flex: 1 1 100%;
  }

  .summary-stats {
    gap: 16px;
  }

  .stat-value {
    font-size: 20px;
  }
}
