/* ============================================
   Blade Archive — Design System & Styles
   ============================================ */

/* ── Custom Properties ── */
:root {
  --bg-base:        #0d0f11;
  --bg-surface-1:   #151819;
  --bg-surface-2:   #1c1f22;
  --bg-surface-3:   #252a2e;

  --border-subtle:  rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong:  rgba(255,255,255,0.16);

  --text-primary:   #e8eaed;
  --text-secondary: #9aa0a6;
  --text-tertiary:  #5f6368;
  --text-link:      #8ab4f8;

  --accent-green:       #34a853;
  --accent-green-dim:   #1a3d2a;
  --accent-green-hover: #245a38;
  --accent-blue:        #8ab4f8;
  --accent-blue-dim:    #1a2a3d;
  --accent-blue-hover:  #243d5a;
  --accent-red:         #ea4335;
  --accent-red-dim:     #3d1a1a;
  --accent-red-hover:   #5a2424;
  --accent-amber:       #fbbc04;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
}

h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.375rem; margin-bottom: 0.625rem; }
h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; margin-bottom: 0.375rem; }

b, strong {
  color: var(--text-primary);
  font-weight: 600;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #aecbfa;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 1.25rem;
}

code, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
}

/* ── Layout ── */
.app-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
}

.main-content {
  padding-top: 32px;
  padding-bottom: 48px;
}

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(13, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.nav-links a:hover {
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
}

.nav-links a.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-2);
}

#auth-nav-items {
  display: contents;
}

#auth-nav-items.hidden {
  display: none;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.nav-toggle:hover {
  background-color: var(--bg-surface-2);
}

.nav-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* ── Footer ── */
footer {
  margin-top: auto;
  padding: 24px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border-subtle);
}

footer hr {
  display: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  color: var(--text-primary);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  background-color: var(--bg-surface-3);
  border-color: var(--border-strong);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.btn:disabled {
  color: var(--text-tertiary);
  background-color: var(--bg-surface-1);
  border-color: var(--border-subtle);
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent-green-dim);
  border-color: rgba(52, 168, 83, 0.25);
  color: var(--accent-green);
  border-left: 3px solid var(--accent-green);
}

.btn-primary:hover {
  background-color: var(--accent-green-hover);
}

.btn-primary:focus-visible {
  outline-color: var(--accent-green);
}

.btn-primary:disabled {
  background-color: var(--bg-surface-1);
  border-color: var(--border-subtle);
  border-left-color: var(--border-subtle);
  color: var(--text-tertiary);
}

.btn-secondary {
  background-color: var(--accent-blue-dim);
  border-color: rgba(138, 180, 248, 0.2);
  color: var(--accent-blue);
}

.btn-secondary:hover {
  background-color: var(--accent-blue-hover);
}

.btn-secondary:focus-visible {
  outline-color: var(--accent-blue);
}

.btn-danger {
  background-color: var(--accent-red-dim);
  border-color: rgba(234, 67, 53, 0.2);
  color: var(--accent-red);
}

.btn-danger:hover {
  background-color: var(--accent-red-hover);
}

.btn-danger:focus-visible {
  outline-color: var(--accent-red);
}

/* Submit button within forms matches .btn style */
form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  color: var(--accent-green);
  background-color: var(--accent-green-dim);
  border: 1px solid rgba(52, 168, 83, 0.25);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

form button[type="submit"]:hover {
  background-color: var(--accent-green-hover);
}

form button[type="submit"]:disabled {
  color: var(--text-tertiary);
  background-color: var(--bg-surface-1);
  border-color: var(--border-subtle);
  border-left-color: var(--border-subtle);
  cursor: not-allowed;
}

.sign-out-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sign-out-btn:hover {
  background-color: var(--bg-surface-3);
  color: var(--text-primary);
}

/* ── Form Inputs ── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
}

.form-group input,
.form-group select {
  width: 100%;
  max-width: 400px;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(138,180,248,0.15);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

select {
  width: 100%;
  max-width: 400px;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(138,180,248,0.15);
}

input[type="file"] {
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

input[type="file"]:disabled {
  background-color: var(--bg-base);
  color: var(--text-tertiary);
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.error-message {
  background-color: var(--accent-red-dim);
  border: 1px solid rgba(234, 67, 53, 0.3);
  color: var(--accent-red);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  max-width: 400px;
  font-size: 0.875rem;
}

/* ── Cards ── */
.card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card-clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
  cursor: pointer;
}

/* ── Tables ── */
.table-container {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

table {
  border-collapse: collapse;
  width: 100%;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border: none;
}

table thead th {
  background-color: var(--bg-surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

table tbody tr:last-child {
  border-bottom: none;
}

table tbody tr:hover {
  background-color: var(--bg-surface-2);
}

/* ── Section Spacing ── */
.section {
  margin-bottom: 32px;
}

.section-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

/* ── Thumbnail Styles ── */
.thumbnail-cell {
  width: 120px;
  text-align: center;
}

.thumbnail-cell img {
  max-width: 100px;
  max-height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.thumbnail-placeholder {
  width: 100px;
  height: 60px;
  background-color: var(--bg-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

/* ── Participant Cards ── */
.participant {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

/* ── Video Preview ── */
.video-preview-container {
  margin: 20px 0;
}

.video-preview {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.video-player-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.video-player-card video {
  display: block;
  max-width: 100%;
}

.video-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.video-meta-grid dt {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.video-meta-grid dd {
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

/* ── Upload Queue ── */
.upload-queue-item {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: opacity 0.5s ease, border-color 0.3s ease;
}

.upload-queue-item .upload-queue-filename {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

/* Custom progress bar */
.upload-queue-item .progress-bar-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.upload-queue-item .progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-green-dim), var(--accent-green));
  transition: width var(--transition-fast);
  width: 0%;
}

/* Fallback for native progress */
.upload-queue-item progress {
  width: 100%;
  height: 6px;
  margin-bottom: 6px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 3px;
  overflow: hidden;
  background-color: var(--bg-surface-2);
}

.upload-queue-item progress::-webkit-progress-bar {
  background-color: var(--bg-surface-2);
  border-radius: 3px;
}

.upload-queue-item progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent-green-dim), var(--accent-green));
  border-radius: 3px;
}

.upload-queue-item progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent-green-dim), var(--accent-green));
  border-radius: 3px;
}

.upload-queue-item .upload-queue-status {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.upload-queue-item.upload-complete {
  border-left-color: var(--accent-green);
  opacity: 0.6;
}

.upload-queue-item.upload-complete .upload-queue-status {
  color: var(--accent-green);
}

.upload-queue-item.upload-error {
  border-left-color: var(--accent-red);
}

.upload-queue-item.upload-error .upload-queue-status {
  color: var(--accent-red);
}

.upload-queue-item .btn-dismiss {
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  background-color: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.upload-queue-item .btn-dismiss:hover {
  background-color: var(--bg-surface-3);
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-tertiary);
  background-color: var(--bg-surface-1);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.drop-zone.drop-zone-enabled {
  cursor: pointer;
}

.drop-zone.drop-zone-enabled:hover,
.drop-zone.drag-over {
  border-color: var(--accent-blue);
  background-color: var(--accent-blue-dim);
  color: var(--text-secondary);
}

.drop-zone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.drop-zone-text {
  font-size: 0.9375rem;
}

.drop-zone-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-zone-loading-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.drop-zone-loading-text.drop-zone-loading-error {
  color: var(--accent-red);
}

.drop-zone-loading-track {
  width: 200px;
  max-width: 100%;
  height: 6px;
  background-color: var(--bg-surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.drop-zone-loading-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-blue-dim), var(--accent-blue));
  transition: width 0.3s ease;
}

/* ── Login Card ── */
.login-card {
  max-width: 420px;
  margin: 80px auto 0;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}

.login-card .site-branding {
  text-align: center;
  margin-bottom: 32px;
}

.login-card .site-branding h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-card .site-branding p {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.login-card .form-group input {
  max-width: none;
  width: 100%;
}

.login-card .error-message {
  max-width: none;
}

.login-card form button[type="submit"] {
  width: 100%;
  justify-content: center;
  padding: 12px 18px;
  margin-top: 8px;
}

/* ── Dashboard ── */
.dashboard-greeting {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.dashboard-greeting span {
  color: var(--text-primary);
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.dashboard-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
  text-decoration: none;
  display: block;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.dashboard-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.dashboard-card p {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  margin: 0;
}

/* Storage meter */
.storage-section {
  margin-top: 24px;
}

.storage-item {
  margin-bottom: 16px;
}

.storage-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.875rem;
}

.storage-item-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.storage-item-value {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8125rem;
}

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

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue-dim), var(--accent-blue));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Fights List ── */
.fights-table-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fights-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}

.fights-empty p {
  margin-bottom: 16px;
}

/* Mobile fight cards */
.fight-cards-mobile {
  display: none;
}

.fight-card-mobile {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.fight-card-mobile:hover {
  background-color: var(--bg-surface-2);
  border-color: var(--border-default);
}

.fight-card-mobile .fight-card-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fight-card-mobile .fight-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fight-card-mobile .fight-card-info {
  flex: 1;
  min-width: 0;
}

.fight-card-mobile .fight-card-opponent {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fight-card-mobile .fight-card-meta {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

/* ── Fight Detail ── */
.fight-header {
  margin-bottom: 24px;
}

.fight-location {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

.fight-participants-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.fight-participants-card h3 {
  padding: 16px 20px 0;
}

.fight-video-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  padding: 20px;
}

.fight-video-card video {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.fight-video-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.fight-video-meta span {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8125rem;
}

.fight-video-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.video-edit-form {
  padding: 16px 0;
}

.video-edit-form .form-group input,
.video-edit-form .form-group select {
  background-color: var(--bg-surface-2);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.video-edit-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
}

.edit-status-success {
  color: var(--accent-green);
  font-size: 0.875rem;
}

.edit-status-queued {
  color: var(--accent-amber);
  font-size: 0.875rem;
}

.edit-status-error {
  color: var(--accent-red);
  font-size: 0.875rem;
}

/* ── Clip Panel ── */
.clip-panel {
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}

.clip-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.clip-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.clip-status {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── Upload Mode Switch (pill tabs) ── */
.upload-mode-switch {
  display: flex;
  padding: 4px;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  width: fit-content;
}

.upload-mode-tab {
  flex: 1;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.upload-mode-tab:hover:not(.active):not(:disabled) {
  background-color: var(--bg-surface-2);
  color: var(--text-secondary);
}

.upload-mode-tab.active {
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.upload-mode-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Segment Upload ── */

.segment-hint {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 0.875rem;
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 8px;
}

.step-indicator-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.step-indicator-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--bg-surface-2);
  color: var(--text-tertiary);
  border: 2px solid var(--border-subtle);
  flex-shrink: 0;
}

.step-indicator-item.active .step-indicator-number {
  background-color: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.step-indicator-item.completed .step-indicator-number {
  background-color: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

.step-indicator-label {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.step-indicator-item.active .step-indicator-label {
  color: var(--text-primary);
  font-weight: 500;
}

.step-indicator-line {
  flex: 1;
  height: 2px;
  background-color: var(--border-subtle);
  margin: 0 12px;
  min-width: 20px;
}

/* Timeline */
.timeline-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mark-display {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.timeline-container {
  cursor: pointer;
  padding: 10px 0;
  margin-bottom: 16px;
}

.timeline-bar {
  position: relative;
  height: 32px;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.timeline-segment {
  position: absolute;
  top: 0;
  height: 100%;
  background-color: rgba(52, 168, 83, 0.25);
  border-left: 2px solid var(--accent-green);
  border-right: 2px solid var(--accent-green);
  box-shadow: inset 0 0 8px rgba(52, 168, 83, 0.15);
}

.timeline-playhead {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: #fff;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* Segment list */
.segment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: background-color var(--transition-fast);
}

.segment-item:hover {
  background-color: var(--bg-surface-2);
}

.segment-index {
  color: var(--text-tertiary);
  font-weight: 700;
  min-width: 24px;
  font-size: 0.875rem;
}

.segment-range {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.segment-duration {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

.segment-btn {
  padding: 4px 10px;
  font-size: 0.8125rem;
}

/* Segment metadata forms */
.segment-metadata-form {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.segment-metadata-range {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: normal;
}

.segment-shared-fields {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

/* Segment upload overall progress */
.segment-overall-label {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.875rem;
}

#segment-overall-bar {
  width: 100%;
  height: 8px;
  margin-bottom: 16px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--bg-surface-2);
}

#segment-overall-bar::-webkit-progress-bar {
  background-color: var(--bg-surface-2);
  border-radius: 4px;
}

#segment-overall-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent-green-dim), var(--accent-green));
  border-radius: 4px;
}

#segment-overall-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent-green-dim), var(--accent-green));
  border-radius: 4px;
}

/* ── Upload page specifics ── */
.uploads-list-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.metadata-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 0.875rem;
  padding: 12px 0;
}

.metadata-grid dt {
  color: var(--text-tertiary);
}

.metadata-grid dd {
  margin: 0;
  color: var(--text-primary);
}

/* ── Converting Badge ── */
.video-converting-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-amber);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 4px 0;
}

.converting-spinner {
  animation: spin 1s linear infinite;
}

.form-hint {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--accent-amber);
  margin-top: 4px;
}

/* ── Animations ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease both;
}

/* ── Mobile: 768px ── */
@media (max-width: 768px) {
  .app-container {
    padding: 0 16px;
  }

  .header-content {
    padding: 0 16px;
  }

  /* Show hamburger, hide nav links */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-surface-1);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 8px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    font-size: 0.9375rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  #auth-nav-items {
    display: contents;
  }

  #auth-nav-items.hidden {
    display: none;
  }

  .site-header {
    position: sticky;
  }

  /* Dashboard grid: single column */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Fights table -> cards */
  .fights-table-desktop {
    display: none;
  }

  .fight-cards-mobile {
    display: block;
  }

  /* Table adjustments */
  table th,
  table td {
    padding: 10px 12px;
    font-size: 0.875rem;
  }

  .thumbnail-cell {
    width: 80px;
  }

  .thumbnail-cell img {
    max-width: 70px;
    max-height: 45px;
  }

  .thumbnail-placeholder {
    width: 70px;
    height: 45px;
    font-size: 0.625rem;
  }

  /* Forms full width */
  .form-group input,
  .form-group select,
  select {
    max-width: 100%;
  }

  .error-message {
    max-width: 100%;
  }

  /* Buttons bigger for touch */
  .btn,
  form button[type="submit"],
  .sign-out-btn {
    min-height: 48px;
    padding: 12px 20px;
  }

  /* Full width primary buttons */
  .btn-primary-full-mobile {
    width: 100%;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .participant {
    padding: 14px;
  }

  /* Video player full width */
  .video-preview-container {
    margin-left: -16px;
    margin-right: -16px;
  }

  .video-preview {
    border-radius: 0;
    max-height: none;
    width: 100%;
  }

  /* Fight detail */
  .fight-video-meta {
    grid-template-columns: 1fr;
  }

  .fight-video-card {
    padding: 16px;
  }

  /* Segment timeline bigger touch targets */
  .timeline-controls {
    flex-wrap: wrap;
  }

  .timeline-bar {
    height: 40px;
  }

  .segment-item {
    flex-wrap: wrap;
  }

  .mark-display {
    width: 100%;
    margin-top: 4px;
  }

  /* Login card */
  .login-card {
    margin-top: 40px;
    padding: 28px 20px;
  }

  /* Step indicator */
  .step-indicator {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .step-indicator-label {
    display: none;
  }

  .step-indicator-line {
    min-width: 12px;
  }
}

/* ── Mobile: 480px ── */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.0625rem; }

  .header-content {
    height: 52px;
  }

  .site-title {
    font-size: 1.2rem;
  }

  .card {
    padding: 16px;
  }

  .dashboard-card {
    padding: 16px;
  }

  .login-card {
    margin-top: 24px;
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }

  .segment-metadata-form {
    padding: 16px;
  }

  .segment-shared-fields {
    padding: 16px;
  }

  .fight-video-card {
    padding: 12px;
  }

  .fight-card-mobile {
    padding: 12px;
    gap: 10px;
  }

  .fight-card-mobile .fight-card-thumb {
    width: 64px;
    height: 42px;
  }
}

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

.block {
  border: 1px solid var(--border-default);
  padding: 8px 16px;
  margin: 0 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.block h1 {
  font-size: 1em;
  text-align: center;
  margin-bottom: 0;
}

.small {
  font-size: 0.8em;
}

.wave {
  background: var(--bg-base);
  color: #fff;
  text-shadow: 1px 1px 10px #fff, 1px 1px 10px #ccc;
}
