/* ══ CARDS — premium motorsport fleet cards ══ */

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Card shell ── */
.car-card {
  background: #141820; border: 1px solid #1f2530;
  border-radius: 14px; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative; cursor: pointer;
  display: flex; flex-direction: column;
}
.car-card:hover {
  border-color: #2a3545;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(212,245,66,0.06);
}

/* ── Photo area ── */
.car-photo {
  width: 100%; height: 160px; background: #0d1018;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.car-photo::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
  background: linear-gradient(transparent, rgba(20,24,32,0.7));
  pointer-events: none;
}
.car-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-photo-placeholder       { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #1f2530; }
.car-photo-placeholder-icon  { font-size: 36px; }
.car-photo-placeholder-text  { font-size: 11px; font-family: 'Barlow Condensed', sans-serif; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }

/* ── Status badge (on photo) ── */
.car-status-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(10,12,15,0.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
}
.car-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.car-status-badge.ready       { color: #22c55e; }
.car-status-badge.ready .car-status-dot       { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.6); }
.car-status-badge.attention   { color: #ef4444; }
.car-status-badge.attention .car-status-dot   { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.6); }
.car-status-badge.in_workshop { color: #f59e0b; }
.car-status-badge.in_workshop .car-status-dot { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.6); }
.car-status-badge.at_event    { color: #3b82f6; }
.car-status-badge.at_event .car-status-dot    { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.6); }

/* ── Delete button ── */
.car-card-delete {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(10,12,15,0.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08); color: #4a5568;
  font-size: 12px; cursor: pointer; border-radius: 6px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  opacity: 0;
}
.car-card:hover .car-card-delete { opacity: 1; }
.car-card-delete:hover { background: rgba(239,68,68,0.2); color: #ef4444; border-color: rgba(239,68,68,0.4); }

/* ── Card body ── */
.car-card-body    { padding: 14px 16px 0; flex: 1; display: flex; flex-direction: column; }
.car-card-name    { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 900; color: #dce3ed; line-height: 1.1; margin-bottom: 1px; }
.car-card-type    { font-size: 12px; color: #7a8a9b; margin-bottom: 4px; }
.car-card-owner   {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600;
  color: #4a5568; letter-spacing: 0.3px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.car-card-divider { height: 1px; background: #1a2030; margin-bottom: 10px; }

/* ── Jobs badge (inline with owner) ── */
.car-jobs-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
  color: #f59e0b; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px; letter-spacing: 0.5px;
  text-transform: uppercase; margin-left: auto;
}
.car-jobs-badge.critical {
  background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.25);
  color: #ef4444;
}

/* ── Metrics row ── */
.car-card-metrics {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
  background: #0f1318; border-radius: 8px; overflow: hidden;
  margin-bottom: 10px;
}
.car-metric {
  text-align: center; padding: 10px 4px;
}
.car-metric + .car-metric { border-left: 1px solid #1a2030; }
.car-metric-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 800; color: #dce3ed; line-height: 1;
}
.car-metric-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: #3a4555; margin-top: 3px;
}
.car-metric.alerts-red .car-metric-value  { color: #ef4444; }
.car-metric.alerts-amber .car-metric-value { color: #f59e0b; }
.car-metric.alerts-ok .car-metric-value   { color: #22c55e; }

/* ── Event row ── */
.car-card-event {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0 10px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 600; color: #4a5568;
}
.car-card-event .material-symbols-outlined { font-size: 15px; color: #3a4555; }
.car-event-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.car-event-date {
  margin-left: auto; font-size: 11px; color: #3a4555; flex-shrink: 0;
}
.car-card-event.active { color: #3b82f6; }
.car-card-event.active .material-symbols-outlined { color: #3b82f6; }
.car-event-badge {
  background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3);
  color: #3b82f6; font-size: 9px; font-weight: 700; letter-spacing: 1px;
  padding: 1px 6px; border-radius: 4px;
}

/* ── Action bar ── */
.car-card-actions {
  display: flex; gap: 0; margin-top: auto;
  border-top: 1px solid #1a2030;
  margin: 0 -16px; /* flush with card edges */
}
.car-action {
  flex: 1; background: transparent; border: none;
  padding: 9px 0; display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: #2a3545;
  cursor: pointer; transition: color 0.15s, background 0.15s;
}
.car-action .material-symbols-outlined { font-size: 14px; }
.car-action + .car-action { border-left: 1px solid #1a2030; }
.car-card:hover .car-action { color: #4a5568; }
.car-action:hover { color: #d4f542 !important; background: rgba(212,245,66,0.04); }

/* ══ LIGHT MODE ══ */
body.light-mode .car-card { background: #ffffff; border-color: #dde2ec; }
body.light-mode .car-card:hover { border-color: #b0b8c4; box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(90,122,0,0.08); }
body.light-mode .car-photo { background: #e8ecf2; }
body.light-mode .car-photo::after { background: linear-gradient(transparent, rgba(255,255,255,0.5)); }
body.light-mode .car-photo-placeholder { color: #c0c8d4; }
body.light-mode .car-status-badge { background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.08); }
body.light-mode .car-card-delete { background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.08); color: #8899aa; }
body.light-mode .car-card-name { color: #1a2030; }
body.light-mode .car-card-type { color: #7a8a9b; }
body.light-mode .car-card-owner { color: #8899aa; }
body.light-mode .car-card-divider { background: #e8ecf2; }
body.light-mode .car-card-metrics { background: #f4f6fa; }
body.light-mode .car-metric + .car-metric { border-left-color: #dde2ec; }
body.light-mode .car-metric-value { color: #1a2030; }
body.light-mode .car-metric-label { color: #8899aa; }
body.light-mode .car-card-event { color: #6b7a8d; }
body.light-mode .car-card-event .material-symbols-outlined { color: #8899aa; }
body.light-mode .car-event-date { color: #8899aa; }
body.light-mode .car-card-actions { border-top-color: #e8ecf2; }
body.light-mode .car-action { color: #c0c8d4; }
body.light-mode .car-card:hover .car-action { color: #8899aa; }
body.light-mode .car-action + .car-action { border-left-color: #e8ecf2; }
body.light-mode .car-action:hover { color: #5a7a00 !important; background: rgba(90,122,0,0.04); }
body.light-mode .car-jobs-badge { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); }
body.light-mode .car-jobs-badge.critical { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); }
