/**
 * LiftTrack Custom Bootstrap Overrides
 * This file loads AFTER Bootstrap to customize the dark theme
 * and add LiftTrack-specific styles
 */

/* ===== CSS Custom Properties ===== */
:root {
  /* Bootstrap theme overrides */
  --bs-primary: #1a3a6e;
  --bs-secondary: #c4a03d;
  --bs-success: #28a745;
  --bs-danger: #dc3545;
  --bs-warning: #ffc107;
  --bs-info: #17a2b8;
  --bs-body-bg: #1a1a2e;
  --bs-body-color: #ffffff;

  /* LiftTrack custom colors */
  --lt-charcoal: #2d2d44;
  --lt-charcoal-light: #3d3d54;
  --lt-primary: #1a3a6e;
  --lt-primary-light: #2a4a7e;
  --lt-secondary: #c4a03d;
  --lt-secondary-light: #d4b04d;
  --lt-good: #28a745;
  --lt-no-good: #dc3545;
  --lt-pass: #6c757d;
  --lt-pending: #495057;

  /* Typography */
  --lt-font-heading: 'Oswald', sans-serif;
  --lt-font-body: 'Roboto', sans-serif;
  --lt-font-mono: 'Roboto Mono', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;

  /* Borders */
  --lt-border-radius: 0.5rem;
  --lt-border-color: rgba(255, 255, 255, 0.1);
}

/* ===== Base Overrides ===== */
body {
  font-family: var(--lt-font-body);
  background-color: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--lt-font-heading);
  font-weight: 600;
}

/* ===== Card Overrides ===== */
.card {
  background: var(--lt-charcoal);
  border: 1px solid var(--lt-border-color);
  border-radius: var(--lt-border-radius);
}

.card-header {
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--lt-border-color);
}

/* ===== Modal Overrides ===== */
.modal-content {
  background: var(--lt-charcoal);
  border: 1px solid var(--lt-border-color);
}

.modal-header {
  border-bottom: 1px solid var(--lt-border-color);
}

.modal-footer {
  border-top: 1px solid var(--lt-border-color);
}

/* ===== Button Customizations ===== */
.btn-primary {
  --bs-btn-bg: var(--lt-primary);
  --bs-btn-border-color: var(--lt-primary);
  --bs-btn-hover-bg: var(--lt-primary-light);
  --bs-btn-hover-border-color: var(--lt-primary-light);
}

.btn-secondary {
  --bs-btn-bg: var(--lt-secondary);
  --bs-btn-border-color: var(--lt-secondary);
  --bs-btn-hover-bg: var(--lt-secondary-light);
  --bs-btn-hover-border-color: var(--lt-secondary-light);
  --bs-btn-color: #000;
  --bs-btn-hover-color: #000;
}

/* Ghost button style */
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* Result buttons - large touch targets */
.btn-result {
  min-height: 48px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) {
  .btn-result {
    min-height: 56px;
  }
}

@media (min-width: 992px) {
  .btn-result {
    min-height: 60px;
  }
}

.btn-result.good {
  --bs-btn-bg: var(--lt-good);
  --bs-btn-border-color: var(--lt-good);
  --bs-btn-hover-bg: #2fb550;
  --bs-btn-hover-border-color: #2fb550;
}

.btn-result.no-good {
  --bs-btn-bg: var(--lt-no-good);
  --bs-btn-border-color: var(--lt-no-good);
  --bs-btn-hover-bg: #e54555;
  --bs-btn-hover-border-color: #e54555;
}

.btn-result.pass {
  --bs-btn-bg: var(--lt-pass);
  --bs-btn-border-color: var(--lt-pass);
  --bs-btn-hover-bg: #7c858d;
  --bs-btn-hover-border-color: #7c858d;
}

/* ===== Form Overrides ===== */
.form-control,
.form-select {
  background-color: var(--lt-charcoal-light);
  border-color: var(--lt-border-color);
  color: #fff;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--lt-charcoal-light);
  border-color: var(--lt-secondary);
  box-shadow: 0 0 0 0.25rem rgba(196, 160, 61, 0.25);
  color: #fff;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Table Overrides ===== */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: #fff;
  --bs-table-border-color: var(--lt-border-color);
}

.table-dark {
  --bs-table-bg: var(--lt-charcoal);
  --bs-table-striped-bg: var(--lt-charcoal-light);
  --bs-table-hover-bg: rgba(196, 160, 61, 0.1);
}

/* ===== Animations ===== */

/* Live indicator pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--lt-good);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--lt-charcoal-light);
  border-top-color: var(--lt-secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Timer danger blink */
@keyframes timerBlink {
  50% { opacity: 0.5; }
}

.timer-danger {
  animation: timerBlink 0.5s infinite;
  color: var(--lt-no-good) !important;
}

/* Platform active glow */
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1); }
}

.platform-active {
  border-left-color: var(--lt-good) !important;
  animation: pulse-border 2s ease-in-out infinite;
}

/* Scoreboard result fade */
@keyframes resultFade {
  0% { opacity: 0; transform: scale(0.8); }
  20% { opacity: 1; transform: scale(1.05); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.result-overlay {
  animation: resultFade 3s ease-out forwards;
}

/* ===== Platform Card ===== */
.platform-card {
  border-left: 4px solid var(--lt-secondary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.platform-card.active {
  border-left-color: var(--lt-good);
  animation: pulse-border 2s ease-in-out infinite;
}

.platform-card.idle {
  border-left-color: var(--lt-pass);
}

/* ===== Demo Mode ===== */
.demo-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 6rem;
  font-family: var(--lt-font-heading);
  font-weight: 700;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  color: var(--lt-secondary);
}

.demo-banner {
  background: linear-gradient(90deg, var(--lt-secondary), #d4b04d);
  color: #000;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.demo-indicator {
  background: var(--lt-secondary);
  color: #000;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== Scoreboard Specific ===== */
.scoreboard-weight-value {
  font-family: var(--lt-font-mono);
  font-weight: 700;
  line-height: 1;
  font-size: 4rem;
}

@media (min-width: 576px) {
  .scoreboard-weight-value { font-size: 5rem; }
}

@media (min-width: 768px) {
  .scoreboard-weight-value { font-size: 6rem; }
}

@media (min-width: 992px) {
  .scoreboard-weight-value { font-size: 7rem; }
}

@media (min-width: 1200px) {
  .scoreboard-weight-value { font-size: 8rem; }
}

/* ===== Timer Display ===== */
.timer-display {
  font-family: var(--lt-font-mono);
  font-size: 2rem;
  font-weight: 700;
  min-width: 80px;
  text-align: center;
}

@media (min-width: 768px) {
  .timer-display {
    font-size: 2.5rem;
    min-width: 100px;
  }
}

/* ===== Live Indicator ===== */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lt-good);
}

/* ===== Stat Cards ===== */
.stat-card {
  text-align: center;
  padding: var(--space-md);
}

.stat-value {
  font-family: var(--lt-font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--lt-secondary);
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Badge Customizations ===== */
.badge-flight {
  background: var(--lt-primary);
  font-weight: 500;
}

.badge-lift-type {
  background: var(--lt-secondary);
  color: #000;
  font-weight: 600;
}

/* ===== Attempt Results ===== */
.attempt-good {
  color: var(--lt-good);
}

.attempt-no-good {
  color: var(--lt-no-good);
  text-decoration: line-through;
}

.attempt-pass {
  color: var(--lt-pass);
}

.attempt-pending {
  color: var(--lt-pending);
}

/* ===== Utility Classes ===== */
.text-gold {
  color: var(--lt-secondary) !important;
}

.bg-charcoal {
  background-color: var(--lt-charcoal) !important;
}

.border-gold {
  border-color: var(--lt-secondary) !important;
}

.font-mono {
  font-family: var(--lt-font-mono) !important;
}

.font-heading {
  font-family: var(--lt-font-heading) !important;
}

/* Touch-friendly minimum sizes */
.touch-target {
  min-height: 48px;
  min-width: 48px;
}
