/* FieldCast App Shared Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #181825;
  --surface-3: #1e1e2e;
  --border: #1e1e2e;
  --border-hover: #2a2a3e;
  --cyan: #00e5ff;
  --cyan-dim: #00e5ff33;
  --cyan-glow: #00e5ff15;
  --cyan-bright: #00f0ff;
  --white: #f0f0f5;
  --gray: #8888a0;
  --gray-light: #aaaabc;
  --red-live: #ff3b3b;
  --green: #00ff88;
  --green-dim: #00ff8833;
  --orange: #ff8800;
  --orange-dim: #ff880033;
  --purple: #a855f7;
  --purple-dim: #a855f733;
  --yellow: #ffd700;
  --yellow-dim: #ffd70033;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

.mono { font-family: 'DM Mono', monospace; }

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--cyan-bright); }

/* ─── App Nav ───────────────────────────────────────── */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 32px;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 700; color: var(--white);
  text-decoration: none; letter-spacing: -0.5px;
}
.nav-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-live); box-shadow: 0 0 8px var(--red-live);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 8px 16px; border-radius: 6px; font-size: 0.875rem;
  color: var(--gray); transition: all 0.2s; text-decoration: none;
}
.nav-link:hover { color: var(--white); background: var(--surface-2); }
.nav-link.active { color: var(--cyan); background: var(--cyan-glow); }
.nav-user {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.85rem; color: var(--gray);
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cyan-dim); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: var(--cyan);
}
.nav-logout {
  background: none; border: 1px solid var(--border); color: var(--gray);
  padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.nav-logout:hover { border-color: var(--red-live); color: var(--red-live); }

/* ─── Page Layout ───────────────────────────────────── */
.app-container {
  max-width: 1200px; margin: 0 auto; padding: 100px 32px 60px;
}
.page-header {
  margin-bottom: 32px;
}
.page-title {
  font-size: 1.75rem; font-weight: 700; margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.page-subtitle {
  color: var(--gray); font-size: 0.95rem;
}

/* ─── Cards ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1rem; font-weight: 600;
}
.card-grid {
  display: grid; gap: 16px;
}
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── Stats ─────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-label {
  font-size: 0.75rem; color: var(--gray); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 8px;
}
.stat-value {
  font-size: 2rem; font-weight: 700; letter-spacing: -1px;
}
.stat-value.cyan { color: var(--cyan); }
.stat-value.green { color: var(--green); }
.stat-value.orange { color: var(--orange); }
.stat-value.purple { color: var(--purple); }

/* ─── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; font-size: 0.9rem;
  font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.25s; border: none; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--cyan); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--cyan-bright); box-shadow: 0 0 24px var(--cyan-dim); }
.btn-secondary { background: transparent; color: var(--white); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--cyan-dim); color: var(--cyan); }
.btn-ghost { background: var(--cyan-glow); color: var(--cyan); border: 1px solid var(--cyan-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--cyan-dim); }
.btn-danger { background: rgba(255,59,59,0.1); color: var(--red-live); border: 1px solid rgba(255,59,59,0.2); }
.btn-danger:hover:not(:disabled) { background: rgba(255,59,59,0.2); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ─── Forms ─────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.8rem; color: var(--gray-light);
  margin-bottom: 8px; font-weight: 500;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--white); font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--cyan);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--gray);
}
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.form-select option { background: var(--surface); color: var(--white); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { color: var(--red-live); font-size: 0.8rem; margin-top: 6px; }
.form-help { color: var(--gray); font-size: 0.8rem; margin-top: 6px; }

/* ─── Status Badges ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-pending { background: var(--yellow-dim); color: var(--yellow); }
.badge-processing { background: var(--cyan-glow); color: var(--cyan); }
.badge-complete { background: var(--green-dim); color: var(--green); }
.badge-failed { background: rgba(255,59,59,0.15); color: var(--red-live); }
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge-processing .badge-dot { animation: pulse-dot 1.5s ease-in-out infinite; }

/* ─── Table ─────────────────────────────────────────── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
th { color: var(--gray); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

/* ─── Progress Bar ──────────────────────────────────── */
.progress-bar {
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright));
  transition: width 0.5s ease;
}

/* ─── Empty State ───────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--gray);
}
.empty-icon {
  font-size: 3rem; margin-bottom: 16px; opacity: 0.5;
}
.empty-title {
  font-size: 1.1rem; color: var(--white); margin-bottom: 8px; font-weight: 600;
}
.empty-text { margin-bottom: 24px; }

/* ─── Auth Pages ────────────────────────────────────── */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 1.4rem; font-weight: 700; margin-bottom: 32px;
}
.auth-logo .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red-live); box-shadow: 0 0 10px var(--red-live);
}
.auth-title {
  font-size: 1.3rem; font-weight: 700; text-align: center; margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--gray); text-align: center; font-size: 0.9rem; margin-bottom: 28px;
}
.auth-divider {
  text-align: center; color: var(--gray); font-size: 0.8rem; margin: 20px 0;
}
.auth-footer {
  text-align: center; color: var(--gray); font-size: 0.85rem; margin-top: 24px;
}
.auth-error {
  background: rgba(255,59,59,0.1); border: 1px solid rgba(255,59,59,0.2);
  color: var(--red-live); padding: 12px 16px; border-radius: 8px;
  font-size: 0.85rem; margin-bottom: 20px; display: none;
}

/* ─── Processing Animation ──────────────────────────── */
.processing-screen {
  text-align: center; padding: 40px 0;
}
.processing-ring {
  width: 120px; height: 120px; margin: 0 auto 24px;
  border: 3px solid var(--border); border-top: 3px solid var(--cyan);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-stage {
  font-size: 1.1rem; color: var(--cyan); margin-bottom: 8px; font-weight: 600;
}
.processing-substage {
  color: var(--gray); font-size: 0.9rem; margin-bottom: 24px;
}

/* ─── Broadcast Result ──────────────────────────────── */
.result-section {
  margin-bottom: 32px;
}
.result-section-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.result-section-title .icon { color: var(--cyan); }
.highlight-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 8px; transition: border-color 0.2s;
}
.highlight-card:hover { border-color: var(--cyan-dim); }
.highlight-time {
  font-family: 'DM Mono', monospace; font-size: 0.85rem;
  color: var(--cyan); min-width: 50px;
}
.highlight-type {
  font-weight: 600; font-size: 0.85rem; min-width: 120px;
}
.highlight-desc {
  color: var(--gray-light); font-size: 0.85rem; flex: 1;
}
.highlight-confidence {
  font-size: 0.75rem; color: var(--green); font-weight: 600;
}
.graphics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.graphic-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; text-align: center;
  font-size: 0.85rem; font-weight: 500;
  transition: border-color 0.2s;
}
.graphic-item:hover { border-color: var(--cyan-dim); }
.graphic-item .icon {
  display: block; font-size: 1.5rem; margin-bottom: 8px;
}

/* ─── Sport Icons ───────────────────────────────────── */
.sport-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.sport-football { background: rgba(139,90,43,0.2); }
.sport-basketball { background: rgba(255,136,0,0.2); }
.sport-baseball { background: rgba(0,229,255,0.2); }
.sport-soccer { background: rgba(0,255,136,0.2); }
.sport-hockey { background: rgba(168,85,247,0.2); }

/* ─── Upload Page ───────────────────────────────────── */
.sport-selector {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.sport-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; background: var(--surface-2);
  border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all 0.2s; font-size: 0.85rem; color: var(--gray);
}
.sport-option:hover { border-color: var(--border-hover); color: var(--white); }
.sport-option.selected { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-glow); }
.sport-option .sport-emoji { font-size: 2rem; }

/* ─── Loading ───────────────────────────────────────── */
.loading-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border); border-top: 3px solid var(--cyan);
  border-radius: 50%; animation: spin 1s linear infinite;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .app-nav { padding: 12px 16px; }
  .app-container { padding: 80px 16px 40px; }
  .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
  .sport-selector { grid-template-columns: repeat(3, 1fr); }
  .highlight-card { flex-wrap: wrap; }
  .auth-card { padding: 28px 24px; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .sport-selector { grid-template-columns: repeat(2, 1fr); }
  .graphics-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.5rem; }
}
