/* FlipCheck Custom Styles - Premium Automotive Theme */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --primary-color: #16a34a;
  --primary-light: #22c55e;
  --secondary-color: #94a3b8;
  --success-color: #059669;
  --danger-color: #dc2626;
  --warning-color: #d97706;
  --info-color: #22c55e;
  --accent-red: #ef4444;
  --accent-gold: #f59e0b;
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --bg-app: #0a0a0a;
  --bg-card: #141418;
  --bg-card-alt: #18181c;
  --bg-nested: #1a1a20;
  --bg-input: #1a1a20;
  --bg-header: linear-gradient(180deg, #0a0a0a 0%, #111318 50%, #1a0a0a 100%);
  --bg-nav: #111318;
  --border-card: #2a2a30;
  --border-input: #333;
  --border-subtle: #3a3a40;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-body: #cbd5e1;
  --light-color: #1a1a20;
  --dark-color: #e2e8f0;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.45);
  --card-shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.2);
  --card-shadow-subtle-hover: 0 4px 16px rgba(0, 0, 0, 0.28);
  --overlay-bg: rgba(0, 0, 0, 0.75);
  --glow-green: rgba(34, 197, 94, 0.3);
  --glow-red: rgba(220, 38, 38, 0.3);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-app: #f4f5f7;
    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;
    --bg-nested: #f1f5f9;
    --bg-input: #ffffff;
    --bg-header: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-nav: #ffffff;
    --border-card: #e2e8f0;
    --border-input: #cbd5e1;
    --border-subtle: #d1d5db;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #475569;
    --text-body: #334155;
    --light-color: #f1f5f9;
    --dark-color: #1e293b;

    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.1);
    --card-shadow-subtle: 0 1px 4px rgba(0, 0, 0, 0.05);
    --card-shadow-subtle-hover: 0 2px 8px rgba(0, 0, 0, 0.08);
    --overlay-bg: rgba(255, 255, 255, 0.92);
    --glow-green: rgba(22, 163, 74, 0.12);
    --glow-red: rgba(220, 38, 38, 0.12);
  }
}

.app-container {
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

/* FlipCheck Logo Styles */
.flipcheck-logo {
  display: inline-block;
  margin-bottom: 15px;
}

.flipcheck-logo img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.flipcheck-main-header {
  background: var(--bg-header);
  border-bottom: none;
  box-shadow: none;
  padding: calc(var(--safe-top) + 10px) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flipcheck-logo-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hero-icon-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2px;
}

.hero-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 110%;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(220, 38, 38, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 40%, rgba(34, 197, 94, 0.16) 0%, transparent 55%);
  filter: blur(44px);
  pointer-events: none;
  z-index: 0;
}

.hero-icon {
  position: relative;
  z-index: 1;
  height: auto;
  width: auto;
  max-height: 80px;
  max-width: min(280px, 60vw);
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(34,197,94,.30)) drop-shadow(0 0 24px rgba(239,68,68,.18));
}

.hero-wordmark {
  margin: 0;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.05;
}

.hero-wordmark-flip {
  color: #f0f0f0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.hero-wordmark-check {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(34,197,94,0.4));
}

.flipcheck-slogan {
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(11px, 2.8vw, 14px);
  font-weight: 600;
  letter-spacing: clamp(1.5px, 0.7vw, 4px);
  margin: 2px 0 0 0;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.flipcheck-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  margin-bottom: 20px;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app) !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', sans-serif;
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports (-webkit-touch-callout: none) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
  body {
    margin: 0;
    padding: 0;
  }
  
  .flipcheck-nav {
    padding-top: max(env(safe-area-inset-top), 15px);
    padding-bottom: 8px;
    margin-top: 5px;
  }
  
  .flipcheck-main-header {
    width: 100vw;
  }

  .hero-icon {
    max-height: 60px;
    max-width: min(200px, 50vw);
  }

  .hero-wordmark {
    font-size: clamp(26px, 8vw, 36px);
  }
  
  .container-fluid {
    padding-left: max(env(safe-area-inset-left), 15px);
    padding-right: max(env(safe-area-inset-right), 15px);
  }
  
  /* Fix mobile bottom buttons being cut off */
  .scanner-card {
    margin-bottom: max(env(safe-area-inset-bottom), 20px);
  }
  
  /* Ensure buttons have proper spacing on mobile */
  .btn {
    margin-bottom: 8px;
  }
  
  /* Mobile button container spacing */
  .d-flex.gap-2 {
    gap: 0.75rem !important;
    margin-bottom: 1rem;
  }
}

.flipcheck-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--accent-gold) 100%);
  color: white;
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow-hover);
  position: relative;
  overflow: hidden;
  /* iOS safe area coverage */
  padding-top: max(env(safe-area-inset-top), 3rem);
  padding-left: max(env(safe-area-inset-left), 1rem);
  padding-right: max(env(safe-area-inset-right), 1rem);
  margin-left: calc(-1 * env(safe-area-inset-left));
  margin-right: calc(-1 * env(safe-area-inset-right));
}

.flipcheck-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
  pointer-events: none;
}

.flipcheck-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.flipcheck-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0;
}

.scanner-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-card);
  transition: var(--transition);
}

.scanner-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.connection-status.connected {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.connection-status.disconnected {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.connection-status.connecting {
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.connected {
  background-color: var(--success-color);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 8px rgba(5, 150, 105, 0.4); }
  50% { box-shadow: 0 0 15px rgba(5, 150, 105, 0.8); }
  100% { box-shadow: 0 0 8px rgba(5, 150, 105, 0.4); }
}

.status-indicator.disconnected {
  background-color: var(--danger-color);
}

.status-indicator.connecting {
  background-color: var(--warning-color);
  animation: blink 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

.vehicle-info-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: none;
}

.vehicle-info-card h5 {
  color: var(--dark-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.vehicle-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.vehicle-detail:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 500;
  color: var(--secondary-color);
}

.detail-value {
  font-weight: 600;
  color: var(--dark-color);
}

.flip-score-card {
  text-align: center;
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  color: white;
}

.flip-score-excellent {
  background: linear-gradient(135deg, var(--success-color), #218838);
}

.flip-score-good {
  background: linear-gradient(135deg, var(--info-color), #138496);
}

.flip-score-fair {
  background: linear-gradient(135deg, var(--warning-color), #e0a800);
  color: var(--dark-color);
}

.flip-score-poor {
  background: linear-gradient(135deg, var(--danger-color), #c82333);
}

.flip-score-number {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.flip-score-label {
  font-size: 1.2rem;
  font-weight: 500;
  opacity: 0.9;
}

.forecast-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--secondary-color);
  font-weight: 500;
}

.trouble-codes {
  margin-top: 1.5rem;
}

.trouble-code-item {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--warning-color);
  box-shadow: var(--card-shadow-subtle);
}

.trouble-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.trouble-code {
  font-weight: 700;
  color: var(--dark-color);
}

.repair-cost {
  font-weight: 600;
  color: var(--danger-color);
}

.trouble-description {
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
}

.error-message {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(220, 53, 69, 0.3);
  margin-bottom: 1rem;
}

.btn-connect {
  background: linear-gradient(135deg, var(--primary-color), #15803d);
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.btn-disconnect {
  background: linear-gradient(135deg, var(--danger-color), #c82333);
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-disconnect:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .flipcheck-header h1 {
    font-size: 2rem;
  }
  
  .flip-score-number {
    font-size: 3rem;
  }
  
  .scanner-card {
    padding: 1.5rem;
  }
  
  .forecast-metrics {
    grid-template-columns: 1fr;
  }
}

/* Navigation styles */
.navbar .nav-link {
  border: none;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.navbar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Garage specific styles */
.garage-vehicle-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.garage-vehicle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.flip-score-mini {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Export section styles */
.export-section {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
  border-left: 4px solid var(--primary-color);
}

/* Vehicle Showcase Styles */
.vehicle-showcase {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 50%, var(--bg-nested) 100%);
  border: 1px solid var(--border-card);
  box-shadow: var(--card-shadow-hover);
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.vehicle-showcase:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(30, 58, 138, 0.2);
}

.vehicle-image-container {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.vehicle-image-container:hover {
  box-shadow: var(--card-shadow-hover);
}

.vehicle-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vehicle-image:hover {
  transform: scale(1.05);
}

.vehicle-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
}

.vehicle-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

.vehicle-model {
  font-size: 1.2rem;
  margin: 0;
  opacity: 0.9;
}

.vehicle-details {
  padding: 20px 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #2a2a30;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.detail-value {
  font-weight: bold;
  color: #e2e8f0;
}

/* FlipScore Gauge Styles */
.flip-score-section {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 50%, var(--bg-nested) 100%);
  border: 1px solid var(--border-card);
  box-shadow: var(--card-shadow-hover);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.flip-score-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center 40%, var(--score-glow, var(--glow-green)) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.flip-score-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  margin-bottom: 8px !important;
}

.flip-gauge-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 10px 16px;
}

.flip-gauge {
  position: relative;
  height: auto;
  margin-bottom: 20px;
  padding: 14px 16px 30px;
  background: var(--bg-nested);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-card);
}

.gauge-track {
  display: flex;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.gauge-segment {
  flex: 1;
  transition: all 0.3s ease;
}

.gauge-red {
  background: linear-gradient(90deg, #dc3545, #e74c3c);
  position: relative;
}

.gauge-orange {
  background: linear-gradient(90deg, #fd7e14, #f39c12);
  position: relative;
}

.gauge-yellow {
  background: linear-gradient(90deg, #ffc107, #f1c40f);
  position: relative;
}

.gauge-green {
  background: linear-gradient(90deg, #28a745, #27ae60);
  position: relative;
}

.gauge-segment::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.gauge-pointer {
  position: absolute;
  top: -12px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid var(--text-primary);
  background: none;
  border-radius: 0;
  transform: translateX(-50%);
  transition: left 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: none;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  animation: needleDrop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes needleDrop {
  0% { top: -30px; opacity: 0; }
  60% { top: -10px; opacity: 1; }
  80% { top: -14px; }
  100% { top: -12px; }
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 600;
}

.flip-score-display {
  text-align: center;
  padding: 12px 16px 16px;
}

.flip-score-number {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 4px;
  text-shadow: 0 0 30px var(--glow-green);
  line-height: 1;
}

.flip-score-rating {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.flip-score-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Financial Breakdown Styles */
.financial-breakdown {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
}

.financial-metric {
  display: flex;
  align-items: center;
  padding: 18px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow-subtle);
  border: 1px solid var(--border-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.financial-metric:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-subtle-hover);
}

.financial-metric.final-profit {
  border: 2px solid var(--primary-color);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
}

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: white;
}

.metric-content {
  flex: 1;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.metric-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
}

/* Live Data Styles */
.live-data-section {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
  color: var(--text-primary);
}

.live-data-metric {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s ease;
}

.live-data-metric:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.live-data-metric .metric-icon {
  background: rgba(255, 255, 255, 0.2);
  margin-right: 12px;
  width: 40px;
  height: 40px;
}

.live-data-metric .metric-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
}

.live-data-metric .metric-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Trouble Code Styles */
.trouble-codes-section {
  background: linear-gradient(135deg, var(--bg-nested), var(--bg-card));
}

.trouble-code-card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 25px;
  border-left: 5px solid #dc3545;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.trouble-code-badge {
  background: #dc3545;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.severity-indicator {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.code-description {
  color: #e2e8f0;
  margin: 10px 0;
  font-size: 1.1rem;
}

.repair-list,
.symptom-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.repair-item,
.symptom-item {
  padding: 8px 0;
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.repair-item i,
.symptom-item i {
  color: #6c757d;
  width: 16px;
  height: 16px;
}

/* Repair Cost Estimate Styles */
.repair-estimates {
  border-top: 2px solid #2a2a30;
  padding-top: 20px;
}

.cost-estimate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  transition: var(--transition);
}

.shop-estimate {
  border-color: #dc3545;
}

.diy-estimate {
  border-color: #28a745;
}

.cost-estimate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.estimate-header {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.shop-estimate .estimate-header {
  color: #dc3545;
}

.diy-estimate .estimate-header {
  color: #28a745;
}

.estimate-breakdown {
  margin-bottom: 15px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-card);
}

.cost-line:last-child {
  border-bottom: none;
}

.total-line {
  border-top: 2px solid var(--border-card);
  margin-top: 10px;
  padding-top: 10px;
}

.estimate-note {
  padding-top: 10px;
  border-top: 1px solid var(--border-card);
}

.total-repair-summary {
  margin-top: 30px;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
  border-radius: 12px;
}

.summary-card {
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.summary-amount {
  font-size: 2rem;
  font-weight: bold;
  margin-top: 10px;
}

/* No Codes Section */
.no-codes-section {
  background: linear-gradient(135deg, var(--bg-nested), var(--bg-card));
  text-align: center;
  padding: 40px;
}

.success-icon {
  width: 64px;
  height: 64px;
  color: #28a745;
}

/* Market Value Section */
.market-value-section {
  background: linear-gradient(135deg, var(--bg-nested), var(--bg-card));
}

.value-metric {
  text-align: center;
  padding: 20px;
}

.value-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.value-amount {
  font-size: 2rem;
  font-weight: bold;
}

.value-range {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.confidence-level {
  font-size: 1.5rem;
  font-weight: bold;
  color: #16a34a;
}

/* Timeline Styles */
.timeline-section {
  background: linear-gradient(135deg, var(--bg-nested), var(--bg-card));
}

.timeline-item {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.timeline-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: white;
}

.timeline-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-primary);
}

.timeline-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* Risk and Opportunity Styles */
.risk-opportunity {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
}

.risk-list,
.opportunity-list {
  list-style: none;
  padding: 0;
}

.risk-item,
.opportunity-item {
  padding: 10px 0;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.risk-item i {
  color: #dc3545;
}

.opportunity-item i {
  color: #28a745;
}

/* Analysis Progress */
.analysis-progress {
  background: linear-gradient(135deg, var(--bg-nested), var(--bg-card));
  border-left: 4px solid #2196f3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .vehicle-image {
    height: 200px;
  }
  
  .flip-score-number {
    font-size: 2.8rem;
  }
  
  .flip-score-rating {
    font-size: 1rem;
    margin-bottom: 6px;
  }
  
  .flip-score-description {
    font-size: 0.85rem;
  }
  
  .flip-score-display {
    padding: 8px 12px 12px;
  }
  
  .flip-gauge-container {
    padding: 6px 10px;
  }
  
  .financial-metric {
    margin-bottom: 10px;
  }
  
  .metric-value {
    font-size: 1.2rem;
  }
  
  .trouble-code-card {
    padding: 15px;
  }
  
  .cost-estimate-card {
    margin-bottom: 10px;
  }
}

/* Connection Main Page */
.connection-main {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.connection-main .flipcheck-header {
  margin-bottom: 40px;
}

/* Connected Dashboard */
.connected-dashboard {
  padding: 40px 0;
}

.action-card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--card-shadow-subtle);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-card);
  height: 100%;
}

.action-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.action-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
}

.action-icon i {
  width: 40px;
  height: 40px;
}

.action-card h5 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.action-card p {
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* Analysis Results */
.analysis-results {
  animation: slideInUp 0.5s ease;
}

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

/* Enhanced scanner connection page */
.scanner-card.connection-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 50px 30px;
  margin: 40px auto;
  max-width: 600px;
}

.scanner-card.connection-card h5 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.scanner-card.connection-card p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.connection-status {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.connection-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  opacity: 0.7;
}

/* Enhanced button styles for connection */
.btn-connection {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  color: white;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-connection:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  background: linear-gradient(135deg, #218838, #1fa085);
}

.btn-demo {
  background: linear-gradient(135deg, #6f42c1, #6610f2);
  border: none;
  color: white;
  padding: 12px 25px;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
}

.btn-demo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
  background: linear-gradient(135deg, #5a36a3, #5a0fd1);
}

/* Responsive adjustments for action cards */
@media (max-width: 768px) {
  .action-card {
    padding: 25px 15px;
    margin-bottom: 20px;
  }
  
  .action-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
  }
  
  .action-icon i {
    width: 30px;
    height: 30px;
  }
  
  .action-card h5 {
    font-size: 1.1rem;
  }
  
  .connection-main {
    min-height: 60vh;
  }
  
  .scanner-card.connection-card {
    margin: 20px auto;
    padding: 40px 20px;
  }
}

/* Compact App Styles */
.flipcheck-main-header {
  background: linear-gradient(180deg, #0a0a0a 0%, #111318 50%, #1a0a0a 100%);
  color: white;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.flipcheck-logo {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Quick Profit Calculator - the hook */
.quick-profit-calculator {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 28px 24px;
  margin: 20px auto;
  max-width: 500px;
  box-shadow: var(--card-shadow-hover);
  border: 1px solid var(--border-card);
  position: relative;
}

.quick-calc-input {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  padding: 12px 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-input) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  transition: all 0.2s ease !important;
}

.quick-calc-input:focus {
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px var(--glow-green) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}

.quick-calc-input::placeholder {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}

.instant-profit-result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border-card);
}

.profit-stat {
  padding: 8px 4px;
}

.profit-decision-badge {
  transition: all 0.3s ease;
}

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

/* Section Divider - Green glow */
.section-divider {
  display: flex;
  align-items: center;
  margin: 30px auto 20px;
  max-width: 500px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22c55e, transparent);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5), 0 0 20px rgba(34, 197, 94, 0.2);
}

.divider-text {
  padding: 0 16px;
  color: #22c55e;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.detailed-analysis-section {
  max-width: 800px;
  margin: 0 auto;
}

/* Quick Input Card */
.quick-input-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin: 0 auto 16px;
  max-width: 800px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-card);
}

.quick-input-card h4 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 28px;
}

.quick-input-card .form-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.quick-input-card .form-control,
.quick-input-card .form-select {
  border-radius: 12px;
  border: 1px solid var(--border-input);
  padding: 12px 15px;
  font-size: 1.1rem;
  transition: var(--transition);
  background: var(--bg-input);
  color: var(--text-primary);
}

.quick-input-card .form-control:focus,
.quick-input-card .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem var(--glow-green);
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Vehicle Summary Card */
.vehicle-summary-card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  border-left: 5px solid var(--primary-color);
}

.vehicle-summary-card h3 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 5px;
}

.asking-price {
  text-align: center;
}

.asking-price small {
  display: block;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.price-display {
  font-size: 1.8rem;
  font-weight: bold;
  color: #16a34a;
  margin-top: 5px;
}

/* Negotiation Card */
.negotiation-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
  border-radius: 15px;
  padding: 25px;
  margin: 20px 0;
  border-left: 5px solid #28a745;
  border: 1px solid var(--border-card);
  border-left: 5px solid #28a745;
}

.negotiation-card h5 {
  color: #28a745;
  font-weight: 700;
  margin-bottom: 20px;
}

.negotiation-price {
  text-align: center;
  padding: 20px;
  background: var(--bg-nested);
  border-radius: 12px;
  box-shadow: var(--card-shadow-subtle);
}

.negotiation-price label {
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.price-big {
  font-size: 2.5rem;
  font-weight: bold;
}

.negotiation-tips h6 {
  color: var(--text-secondary);
  font-weight: bold;
  margin-bottom: 15px;
}

.negotiation-tips ul {
  list-style-type: none;
  padding: 0;
}

.negotiation-tips li {
  padding: 8px 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 25px;
}

.negotiation-tips li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
}

/* Compact Analysis */
.main-analysis-page {
  padding-bottom: 40px;
}

.scanner-section {
  margin: 30px 0;
}

.results-page {
  padding-bottom: 40px;
}

.action-buttons {
  margin: 30px 0;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
}

.quick-links {
  margin: 40px 0;
  padding: 20px;
}

/* Navigation improvements */
.flipcheck-nav {
  background: var(--bg-nav);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.flipcheck-nav .btn {
  border-radius: 20px;
  font-weight: 600;
}

/* Error message improvements */
.error-message {
  background: rgba(220, 53, 69, 0.1);
  color: var(--accent-red);
  padding: 15px 20px;
  border-radius: 12px;
  margin: 20px 0;
  border-left: 4px solid var(--accent-red);
  border: 1px solid rgba(220, 53, 69, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .flipcheck-logo {
    font-size: 2.2rem;
  }
  
  .flipcheck-slogan {
    font-size: clamp(10px, 2.5vw, 13px);
  }
  
  .quick-input-card {
    margin: 20px 15px;
    padding: 20px;
  }
  
  .vehicle-summary-card {
    padding: 20px;
  }
  
  .price-display {
    font-size: 1.5rem;
  }
  
  .price-big {
    font-size: 2rem;
  }
  
  .negotiation-card {
    padding: 20px;
  }
  
  .asking-price {
    margin-top: 15px;
    text-align: left;
  }
}

/* Enhanced button styles */
.btn-lg {
  padding: 15px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-primary.btn-lg {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.3);
}

.btn-primary.btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.btn-success.btn-lg {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  border: none;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success.btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Compact Navigation Button Override */
.compact-nav-btn, 
button[style*="minWidth"] {
  padding: 6px 10px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  height: 32px !important;
  min-width: auto !important;
  max-width: 120px !important;
  white-space: nowrap !important;
}

/* Compact FlipForecast Styles */
.flip-forecast-compact {
  margin-bottom: 20px;
}

.profit-summary {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-nested));
  border-left: 4px solid #28a745;
}

.profit-metric {
  padding: 20px;
  text-align: center;
}

.profit-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.profit-amount {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.profit-breakdown {
  padding: 15px 20px;
  background: var(--bg-nested);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  margin-top: 15px;
}

.issues-summary {
  background: linear-gradient(135deg, var(--bg-nested), var(--bg-card));
  border-left: 4px solid #ffc107;
}

.issue-code {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.clickable-code {
  transition: all 0.2s ease;
  cursor: pointer !important;
}

.clickable-code:hover {
  background: rgba(234, 179, 8, 0.25) !important;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Trouble Code Modal Styles */
.modal-backdrop.show {
  opacity: 1;
}

.modal-dialog.show {
  transform: scale(1);
}

.section-title {
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 2px solid #2a2a30;
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.cost-breakdown .cost-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cost-breakdown .cost-total,
.cost-breakdown .cost-savings {
  border-top: 1px solid var(--border-card);
  padding-top: 8px;
  margin-top: 8px;
}

.savings-amount {
  color: #28a745;
}

.difficulty.easy { color: #28a745; }
.difficulty.moderate { color: #ffc107; }
.difficulty.hard { color: #dc3545; }

/* Compact Scanner Styles */
.scanner-card-compact {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0;
  border: 1px solid var(--border-card);
}

.connection-status-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--bg-nested);
  border-radius: 8px;
}

.connection-status-compact .status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
}

.connection-status-compact .status-indicator.connecting,
.connection-status-compact .status-indicator.retrieving {
  background: #ffc107;
  animation: pulse 1.5s infinite;
}

.connection-status-compact .status-indicator.connected {
  background: #28a745;
}

.connection-status-compact .status-indicator.disconnected {
  background: #dc3545;
}

.status-text {
  font-weight: 600;
  font-size: 0.9rem;
}

/* PWA specific styles */
@media (display-mode: standalone) {
  body {
    padding-top: 0;
  }
}

/* Time Estimate Cards */
.time-estimate-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--bg-nested);
  border-radius: 14px;
  border: 1px solid var(--border-card);
  transition: var(--transition);
  min-height: 80px;
}

.time-estimate-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px var(--glow-green);
}

.time-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  box-shadow: 0 4px 12px var(--glow-green);
}

.time-content .time-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 2px;
}

.time-content .time-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Risk and Opportunities Lists */
.risk-opportunities-list {
  min-height: 120px;
}

.risk-item, .opportunity-item, .no-items {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a30;
  font-size: 14px;
  line-height: 1.4;
}

.risk-item:last-child, .opportunity-item:last-child, .no-items:last-child {
  border-bottom: none;
}

.no-items {
  color: #6c757d;
  font-style: italic;
  justify-content: center;
  padding: 20px;
  border: none;
}

/* Premium Button Styles */
.btn {
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.025em;
  transition: var(--transition);
  border: none;
  padding: 12px 24px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-connect {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.btn-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
  color: white;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color), #64748b);
  color: white;
  box-shadow: 0 4px 15px rgba(71, 85, 105, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(71, 85, 105, 0.4);
  color: white;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #10b981);
  color: white;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
  color: white;
}

/* Enhanced Form Controls */
.form-control {
  border-radius: 12px;
  border: 2px solid rgba(226, 232, 240, 0.8);
  transition: var(--transition);
  padding: 12px 16px;
  font-weight: 500;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.15);
}

.form-select {
  border-radius: 12px;
  border: 2px solid rgba(226, 232, 240, 0.8);
  transition: var(--transition);
  padding: 12px 16px;
  font-weight: 500;
}

.form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.15);
}

/* Barcode Scanner Styles */
.scanner-viewfinder {
  border: 3px solid var(--primary-light);
  border-radius: var(--border-radius);
  box-shadow: 
    0 0 0 4px rgba(34, 197, 94, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.scanner-overlay {
  background: linear-gradient(90deg, transparent 0%, var(--primary-light) 50%, transparent 100%);
  box-shadow: 0 0 10px var(--primary-light);
}

/* Mobile Touch Enhancements */
@media (max-width: 768px) {
  .btn {
    padding: 14px 28px;
    font-size: 1.1rem;
    min-height: 48px;
  }
  
  .flip-gauge {
    height: auto;
    padding: 12px 14px 26px;
  }
  
  .gauge-track {
    height: 18px;
    border-radius: 9px;
  }
  
  .gauge-pointer {
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 12px solid var(--text-primary);
    top: -10px;
  }

  /* Mobile barcode scanner optimizations */
  .scanner-viewfinder {
    border-width: 2px;
  }
}

/* ===== THEME-AWARE GLOBAL OVERRIDES ===== */

/* Red accent stripe below header */
.flipcheck-main-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 5%, #dc2626 20%, #ef4444 50%, #dc2626 80%, transparent 95%);
  box-shadow: 0 0 15px var(--glow-red), 0 0 30px rgba(220, 38, 38, 0.1);
}

/* Bootstrap form overrides */
.input-group-text {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-input) !important;
  color: var(--text-secondary) !important;
}

.form-control, .form-select {
  background-color: var(--bg-input) !important;
  border-color: var(--border-input) !important;
  color: var(--text-primary) !important;
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-input) !important;
  border-color: var(--primary-light) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 0 0 0.2rem var(--glow-green) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

.form-select option {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Navigation theme */
.flipcheck-nav {
  background: var(--bg-nav) !important;
  border-bottom: 1px solid var(--border-card) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Card backgrounds */
.card, .modal-content {
  background: var(--bg-card) !important;
  border-color: var(--border-card) !important;
  color: var(--text-primary) !important;
}

/* Text helpers */
.text-dark {
  color: var(--text-primary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Trouble code detail modal - ensure readable text in all themes */
.trouble-code-details .alert-info {
  color: var(--text-primary) !important;
  background-color: var(--bg-nested) !important;
  border-color: var(--border-card) !important;
}

.trouble-code-details .alert-info p {
  color: var(--text-primary) !important;
}

.trouble-code-details .list-group-item {
  background-color: var(--bg-card) !important;
  border-color: var(--border-card) !important;
  color: var(--text-primary) !important;
}

.trouble-code-details .cost-breakdown span,
.trouble-code-details .cost-breakdown strong {
  color: var(--text-primary) !important;
}

.trouble-code-details .cost-breakdown .text-primary {
  color: #0d6efd !important;
}

.trouble-code-details .cost-breakdown .text-success {
  color: #22c55e !important;
}

.trouble-code-details .card-body {
  color: var(--text-primary) !important;
}

.trouble-code-details .symptoms-section .col-md-6 {
  color: var(--text-primary) !important;
}

.trouble-code-details .section-title {
  color: var(--text-primary) !important;
}

.trouble-code-details hr {
  border-color: var(--border-card) !important;
}

/* ===== LIGHT MODE COMPONENT OVERRIDES ===== */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body {
    color-scheme: light;
  }

  :root:not([data-theme="dark"]) .flipcheck-slogan {
    color: rgba(255, 255, 255, 0.9);
  }

  :root:not([data-theme="dark"]) .hero-icon-glow {
    opacity: 0.6;
  }

  :root:not([data-theme="dark"]) .gauge-pointer {
    border-top-color: #1e293b;
  }

  :root:not([data-theme="dark"]) .flip-score-number {
    text-shadow: none;
  }

  :root:not([data-theme="dark"]) .gauge-labels {
    color: var(--text-muted);
  }

  :root:not([data-theme="dark"]) .flip-score-section::before {
    opacity: 0.3;
  }

  :root:not([data-theme="dark"]) .verdict-banner .verdict-detail {
    color: var(--text-muted);
  }

  :root:not([data-theme="dark"]) .scanner-card {
    border-color: var(--border-card);
  }

  :root:not([data-theme="dark"]) .btn::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  }

  :root:not([data-theme="dark"]) .detail-row {
    border-bottom-color: var(--border-card);
  }

  :root:not([data-theme="dark"]) .risk-item,
  :root:not([data-theme="dark"]) .opportunity-item {
    border-bottom-color: var(--border-card);
    color: var(--text-body);
  }

  :root:not([data-theme="dark"]) .timeline-item {
    background: var(--bg-nested);
    border: 1px solid var(--border-card);
  }

  :root:not([data-theme="dark"]) .financial-metric {
    background: var(--bg-nested);
  }

  :root:not([data-theme="dark"]) .trouble-code-card {
    background: var(--bg-card);
    border-left-color: var(--warning-color);
  }
}

/* ===== SECONDARY CARD STYLING (reduced glow) ===== */
.scanner-card.card-secondary,
.scanner-card:is(.risk-opportunity, .timeline-section) {
  box-shadow: var(--card-shadow-subtle);
}
.scanner-card.card-secondary:hover,
.scanner-card:is(.risk-opportunity, .timeline-section):hover {
  box-shadow: var(--card-shadow-subtle-hover);
  transform: translateY(-1px);
}

/* ===== VERDICT BANNER ===== */
.verdict-banner {
  border-radius: 20px;
  padding: 28px 24px;
  margin-bottom: 20px;
  text-align: center;
}
.verdict-banner .verdict-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.verdict-banner .verdict-title {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.15;
}
.verdict-banner .verdict-profit {
  font-size: 2.2rem;
  font-weight: 900;
  margin-top: 12px;
}
.verdict-banner .verdict-detail {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 6px;
}
.verdict-banner .verdict-warning {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  display: inline-block;
}

/* ===== TYPOGRAPHY SHARPENING ===== */
.scanner-card h4,
.scanner-card h5 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
@media (min-width: 769px) {
  .scanner-card h4,
  .scanner-card h5 {
    font-size: 1.5rem;
  }
}
.scanner-card p,
.scanner-card .metric-label,
.scanner-card li {
  color: var(--text-body, #cbd5e1);
  line-height: 1.6;
}
.scanner-card small,
.scanner-card .text-muted,
.scanner-card .helper-text {
  color: var(--text-muted) !important;
}

/* ===== VIN SCANNER (hybrid native + ZXing) ===== */
@keyframes vinScanLineAnim {
  0% { top: 10%; opacity: 0.3; }
  50% { top: 85%; opacity: 1; }
  100% { top: 10%; opacity: 0.3; }
}
.vin-scan-line {
  animation: vinScanLineAnim 2s ease-in-out infinite;
}

/* ===== RESPONSIVE CONTAINER ===== */
@media (min-width: 769px) {
  .flip-forecast-compact,
  .detailed-analysis-section,
  .manual-input-section {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 768px) {
  .scanner-card {
    margin-left: 0;
    margin-right: 0;
    border-radius: 12px;
  }
  .flip-forecast-compact {
    padding: 0 4px;
  }
}
