/* App pages — Analyze, Dashboard, etc.
   Extends theme.css tokens (--bg, --surface, --accent, etc.) */

.analyze-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 48px 80px;
}

.analyze-header {
  padding: 64px 0 48px;
}

.analyze-sub {
  margin-top: 12px;
  color: var(--fg-muted);
  font-size: 16px;
  max-width: 480px;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 64px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  margin-bottom: 32px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-zone.drag-over .upload-prompt { transform: scale(1.03); }

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--fg-muted);
  transition: transform 0.2s;
}

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

.upload-browse {
  color: var(--accent);
  font-weight: 500;
}

.upload-hint {
  font-size: 13px;
  color: var(--fg-muted);
  opacity: 0.7;
}

/* Video preview */
.video-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.video-preview video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  max-height: 360px;
  object-fit: contain;
}

.video-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 16px;
}

.video-name {
  font-size: 14px;
  color: var(--fg-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: 0.85; }

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-loading { display: flex; align-items: center; gap: 6px; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

/* Progress */
.progress-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

/* Court diagram */
.report { margin-top: 0; }

.report-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.report-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-bottom: 24px;
}

.court-container { position: relative; }

.court-diagram {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
}

.court-surface {
  position: absolute;
  inset: 8%;
  border: 2px solid var(--court-line);
  background: var(--accent-dim);
}

.court-line {
  position: absolute;
  background: var(--court-line);
}

.court-line.h-top { top: 33%; height: 2px; left: 0; right: 0; }
.court-line.h-bottom { bottom: 33%; height: 2px; left: 0; right: 0; }
.court-line.v-left { left: 50%; width: 2px; top: 0; bottom: 0; }

/* Shot dot on court */
.shot-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Hot zone */
.hot-zone {
  position: absolute;
  border-radius: 50%;
  background: rgba(240, 165, 0, 0.2);
  filter: blur(16px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.court-label {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-tag {
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.label-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--fg-muted);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

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

/* Zone breakdown bars */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.zone-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.zone-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 10px;
}

.zone-bar-wrap {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.zone-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.zone-count {
  font-size: 12px;
  color: var(--fg-muted);
}

.report-actions {
  display: flex;
  justify-content: flex-end;
}

/* Utility */
.hidden { display: none !important; }

/* Nav extras */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--fg); }

@media (max-width: 768px) {
  .analyze-page { padding: 0 24px 60px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .zone-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-zone { padding: 40px; }
}

@media (max-width: 480px) {
  .analyze-header { padding: 40px 0 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .zone-grid { grid-template-columns: 1fr; }
}