/* ============================================================
   AutoCare shared styles
   Shared patterns extracted from individual page components.
   Only add styles here if used in 2+ places.
   ============================================================ */

/* ----------------------------------------------------------
   Screen containers
   ---------------------------------------------------------- */
.ac-page,
.ac-detail-page,
.ac-vehicles-page,
.ac-logs-page,
.ac-schedule-page,
.ac-analytics-page {
  min-height: 100%;
  background: var(--ac-bg);
}

.ac-form-page,
.ac-new-vehicle,
.ac-edit-vehicle,
.ac-more-page {
  min-height: 100%;
  background: var(--ac-bg);
  padding-bottom: 2rem;
}

/* ----------------------------------------------------------
   Page body wrapper
   ---------------------------------------------------------- */
.ac-page-body {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

/* ----------------------------------------------------------
   Page count
   ---------------------------------------------------------- */
.ac-page-count {
  font-size: 0.82rem;
  color: var(--ac-text-muted);
  font-weight: 500;
}

/* ----------------------------------------------------------
   AutoCare card override — all Bootstrap .card elements
   inside the AutoCare shell inherit these styles
   ---------------------------------------------------------- */
.ac-shell .card {
  background: var(--ac-card-bg);
  border: 1px solid var(--ac-border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ----------------------------------------------------------
   Error banner
   ---------------------------------------------------------- */
.ac-error-banner {
  max-width: 640px;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ----------------------------------------------------------
   Buttons (list page actions)
   ---------------------------------------------------------- */
.ac-add-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  background: #4361ee;
  color: #fff;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}

.ac-add-btn:hover { background: #3451d4; }

.ac-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.5rem;
  background: #4361ee;
  color: #fff;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: background 0.15s;
}

.ac-cta-btn:hover { background: #3451d4; }

/* ----------------------------------------------------------
   Empty state
   ---------------------------------------------------------- */
.ac-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 1rem;
  gap: 0.75rem;
}

.ac-empty-icon-wrap {
  width: 72px;
  height: 72px;
  background: var(--ac-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--ac-text-subtle);
  margin-bottom: 0.5rem;
}

.ac-empty-title { font-size: 1.05rem; font-weight: 700; color: var(--ac-text-secondary); margin: 0; }
.ac-empty-sub   { font-size: 0.85rem; color: var(--ac-text-muted); margin: 0; max-width: 280px; }

.ac-empty-state--sm { padding: 3rem 1rem; gap: 0.5rem; }
.ac-empty-state--sm .ac-empty-icon-wrap { width: 60px; height: 60px; font-size: 1.6rem; margin-bottom: 0.4rem; }
.ac-empty-state--sm .ac-empty-title { font-size: 1rem; }
.ac-empty-state--sm .ac-empty-sub { max-width: 240px; }

/* ----------------------------------------------------------
   Detail card
   ---------------------------------------------------------- */
.ac-card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1rem 1rem 1.1rem;
  background: var(--ac-card-bg);
  border-bottom: 1px solid var(--ac-sheet-cancel-bg);
}

.ac-card-icon {
  width: 48px;
  height: 48px;
  background: var(--ac-icon-bg);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #4361ee;
  flex-shrink: 0;
}

.ac-card-identity { flex: 1; min-width: 0; }

.ac-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ac-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-card-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ac-text-muted);
  margin-top: 0.2rem;
}

/* ----------------------------------------------------------
   ⋮ Menu / Dropdown
   ---------------------------------------------------------- */
.ac-menu-wrap { position: relative; flex-shrink: 0; }

.ac-menu-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ac-sheet-cancel-bg);
  border: none;
  border-radius: 8px;
  color: var(--ac-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.ac-menu-btn:hover { background: var(--ac-border); }

.ac-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--ac-card-bg);
  border: 1.5px solid var(--ac-border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 164px;
  z-index: 100;
  overflow: hidden;
}

.ac-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ac-text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background 0.12s;
}

.ac-dropdown-item:hover { background: var(--ac-sheet-opt-bg); }
.ac-dropdown-item i { font-size: 0.85rem; color: var(--ac-text-muted); }
.ac-dropdown-item--danger { color: #ef4444; }
.ac-dropdown-item--danger i { color: #ef4444; }
.ac-dropdown-divider { height: 1px; background: var(--ac-sheet-cancel-bg); margin: 0.2rem 0; }

/* ----------------------------------------------------------
   Card body & field rows
   ---------------------------------------------------------- */
.ac-card-body { background: var(--ac-sheet-opt-bg); padding: 0.75rem; }

.ac-card-fields {
  background: var(--ac-card-bg);
  border-radius: 2px;
  padding: 0 0.9rem;
}

.ac-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--ac-sheet-cancel-bg);
  gap: 1rem;
}

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

.ac-field-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ac-text-muted);
  flex-shrink: 0;
}

.ac-field-label i { font-size: 0.85rem; }

.ac-field-value {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ac-text-secondary);
  text-align: right;
}

.ac-field-value--muted { color: var(--ac-text-subtle); font-weight: 400; font-style: italic; }

/* ----------------------------------------------------------
   Section label + link
   ---------------------------------------------------------- */
.ac-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ac-text-subtle);
}

.ac-section-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #4361ee;
  text-decoration: none;
}

/* ----------------------------------------------------------
   Stat card (vehicle detail activity widget)
   ---------------------------------------------------------- */
.ac-stat-stripe { width: 4px; flex-shrink: 0; }
.ac-stat-stripe--fuel  { background: #b91c1c; }
.ac-stat-stripe--maint { background: #16a34a; }

.ac-stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.ac-stat-icon--fuel  { background: #fef2f2; color: #b91c1c; }
.ac-stat-icon--maint { background: #f0fdf4; color: #16a34a; }

.ac-stat-btn {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 0.28rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
}
.ac-stat-btn--view  { background: var(--ac-sheet-cancel-bg); color: var(--ac-text-muted); }
.ac-stat-btn--fuel  { background: #fef2f2; color: #b91c1c; }
.ac-stat-btn--maint { background: #f0fdf4; color: #16a34a; }

/* ----------------------------------------------------------
   Delete confirmation modal
   ---------------------------------------------------------- */
.ac-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.ac-modal {
  background: var(--ac-card-bg);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.ac-modal-icon  { font-size: 2rem; color: #ef4444; margin-bottom: 0.75rem; }
.ac-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--ac-text-primary); margin: 0 0 0.4rem; }
.ac-modal-body  { font-size: 0.85rem; color: var(--ac-text-muted); margin: 0 0 1.5rem; }

.ac-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.ac-modal-btn {
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.ac-modal-btn:hover { opacity: 0.85; }
.ac-modal-btn--cancel  { background: var(--ac-sheet-cancel-bg); color: var(--ac-label-color); }
.ac-modal-btn--confirm { background: #ef4444; color: #fff; }

/* ----------------------------------------------------------
   Spinner
   ---------------------------------------------------------- */
@keyframes ac-spin { to { transform: rotate(360deg); } }
.ac-spin { display: inline-block; animation: ac-spin 0.7s linear infinite; }

/* ----------------------------------------------------------
   Vue transition utilities
   ---------------------------------------------------------- */
.ac-fade-enter-active, .ac-fade-leave-active { transition: opacity 0.2s ease; }
.ac-fade-enter-from,  .ac-fade-leave-to      { opacity: 0; }

.ac-slide-up-enter-active, .ac-slide-up-leave-active { transition: transform 0.25s ease; }
.ac-slide-up-enter-from,   .ac-slide-up-leave-to     { transform: translateY(40px); }

.ac-sheet-fade-enter-active, .ac-sheet-fade-leave-active { transition: opacity 0.2s ease; }
.ac-sheet-fade-enter-from,   .ac-sheet-fade-leave-to     { opacity: 0; }

.ac-sheet-slide-enter-active, .ac-sheet-slide-leave-active { transition: transform 0.25s ease; }
.ac-sheet-slide-enter-from,   .ac-sheet-slide-leave-to     { transform: translateY(100%); }

/* ----------------------------------------------------------
   List item row grid  (shared across vehicle, fuel, service-center rows)
   2-column grid: left grows, right shrinks to content
   Row 1: title (tl) + badge (tr)
   Row 2: meta  (bl) + sub   (br)
   ---------------------------------------------------------- */
.ac-item-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.5rem;
  min-width: 0;
}
.ac-item-title {
  grid-column: 1; grid-row: 1;
  font-size: 0.85rem; font-weight: 700;
  color: var(--ac-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-item-badge {
  grid-column: 2; grid-row: 1;
  font-size: 0.72rem; font-weight: 600;
  color: var(--ac-text-subtle);
  align-self: start; text-align: right; white-space: nowrap;
}
.ac-item-meta {
  grid-column: 1; grid-row: 2;
  font-size: 0.72rem;
  color: var(--ac-text-muted);
  margin-top: 0.12rem;
}
.ac-item-sub {
  grid-column: 2; grid-row: 2;
  font-size: 0.7rem;
  color: var(--ac-text-muted);
  align-self: end; text-align: right; white-space: nowrap;
}

/* ----------------------------------------------------------
   Summary card (list page header card)
   ---------------------------------------------------------- */
.ac-summary-card {
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.ac-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 1;
}

.ac-summary-period {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ac-text-subtle);
}

.ac-summary-metrics { display: flex; align-items: center; position: relative; z-index: 1; }

/* Corner art variants — add ::after SVG art to any .ac-summary-card */
.ac-summary-card--drift::after,
.ac-summary-card--drift-orange::after,
.ac-summary-card--terrain::after,
.ac-summary-card--terrain-red::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-size: 100% 100%;
}

.ac-summary-card--drift::after {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 110' preserveAspectRatio='none'><path d='M 155,110 C 190,88 220,102 255,80 C 282,62 310,74 335,60 C 348,53 356,56 360,54 L 360,110 Z' fill='%2360a5fa' fill-opacity='0.13'/><path d='M 360,110 L 360,68 C 348,75 332,85 310,95 C 288,105 268,110 268,110 Z' fill='%2393c5fd' fill-opacity='0.18'/></svg>");
}

.ac-summary-card--terrain::after {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 110' preserveAspectRatio='none'><path d='M 185,110 L 232,52 L 268,78 L 308,26 L 342,62 L 360,48 L 360,110 Z' fill='%23fbbf24' fill-opacity='0.12'/><path d='M 360,110 L 360,72 C 344,80 324,92 298,102 C 278,110 260,110 260,110 Z' fill='%23fcd34d' fill-opacity='0.22'/></svg>");
}

.ac-summary-card--drift-orange::after {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 110' preserveAspectRatio='none'><path d='M 155,110 C 190,88 220,102 255,80 C 282,62 310,74 335,60 C 348,53 356,56 360,54 L 360,110 Z' fill='%23f59e0b' fill-opacity='0.13'/><path d='M 360,110 L 360,68 C 348,75 332,85 310,95 C 288,105 268,110 268,110 Z' fill='%23fbbf24' fill-opacity='0.18'/></svg>");
}

.ac-summary-card--terrain-red::after {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 110' preserveAspectRatio='none'><path d='M 185,110 L 232,52 L 268,78 L 308,26 L 342,62 L 360,48 L 360,110 Z' fill='%23f87171' fill-opacity='0.12'/><path d='M 360,110 L 360,72 C 344,80 324,92 298,102 C 278,110 260,110 260,110 Z' fill='%23fca5a5' fill-opacity='0.22'/></svg>");
}

.ac-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.ac-metric-value { font-size: 1rem; font-weight: 800; color: var(--ac-text-primary); }
.ac-metric-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ac-text-subtle); }
.ac-metric-divider { width: 1px; height: 32px; background: var(--ac-border); }

/* ----------------------------------------------------------
   Filter / icon button + active dot
   ---------------------------------------------------------- */
.ac-filter-btn {
  position: relative;
  background: var(--ac-sheet-cancel-bg);
  border: 1.5px solid var(--ac-border);
  color: var(--ac-label-color);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.ac-filter-btn:hover { background: var(--ac-border); border-color: var(--ac-dot-color); }

.ac-filter-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: #f59e0b;
  border-radius: 50%;
  border: 1.5px solid var(--ac-sheet-bg);
}

/* ----------------------------------------------------------
   Filter sheet (bottom sheet)
   ---------------------------------------------------------- */
.ac-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ac-sheet {
  background: var(--ac-sheet-bg);
  border-radius: 20px 20px 0 0;
  padding: 0.75rem 1.25rem 2.5rem;
  width: 100%;
  max-width: 560px;
}

.ac-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--ac-border);
  border-radius: 2px;
  margin: 0 auto 1.25rem;
}

.ac-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.ac-sheet-title { font-size: 1rem; font-weight: 700; color: var(--ac-text-primary); }

.ac-sheet-reset {
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4361ee;
  cursor: pointer;
  padding: 0;
}

/* ----------------------------------------------------------
   Filter fields (inside sheet)
   ---------------------------------------------------------- */
.ac-filter-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ac-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ac-filter-field { display: flex; flex-direction: column; gap: 0.35rem; }

.ac-filter-label { font-size: 0.75rem; font-weight: 600; color: var(--ac-label-color); }

.ac-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--ac-border);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--ac-text-primary);
  background: var(--ac-sheet-opt-bg);
  outline: none;
  box-sizing: border-box;
  appearance: none;
  transition: border-color 0.15s;
}

.ac-input:focus { border-color: #4361ee; background: var(--ac-sheet-bg); }

/* ----------------------------------------------------------
   Form inputs (larger sizing for dedicated form pages)
   ---------------------------------------------------------- */
.ac-form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--ac-border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--ac-text-primary);
  background: var(--ac-sheet-opt-bg);
  outline: none;
  box-sizing: border-box;
  appearance: none;
  transition: border-color 0.15s;
}

.ac-form-input:focus { border-color: #4361ee; background: var(--ac-sheet-bg); }
.ac-form-input--textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.ac-form-input--prefixed { padding-left: 3.5rem; }

/* ----------------------------------------------------------
   Form input wrapper helpers
   ---------------------------------------------------------- */
.ac-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ac-input-wrap .ac-form-input { padding-right: 2.5rem; }

.ac-input-unit {
  position: absolute;
  right: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ac-text-subtle);
  pointer-events: none;
}

.ac-input-prefix {
  position: absolute;
  left: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ac-text-subtle);
  pointer-events: none;
  z-index: 1;
}

/* ----------------------------------------------------------
   Form section label (card section heading inside a form)
   ---------------------------------------------------------- */
.ac-form-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ac-text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ac-apply-btn {
  width: 100%;
  padding: 0.95rem;
  background: #4361ee;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.ac-apply-btn:hover { background: #3451d4; }

/* ----------------------------------------------------------
   Field error
   ---------------------------------------------------------- */
.ac-field-error {
  font-size: 0.75rem;
  font-weight: 500;
  color: #ef4444;
  margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   Load more button
   ---------------------------------------------------------- */
.ac-load-more-btn {
  border: 1.5px solid var(--ac-border);
  border-radius: 10px;
  background: var(--ac-sheet-opt-bg);
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ac-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ac-load-more-btn:hover { border-color: #4361ee; color: #4361ee; }
.ac-load-more-btn:disabled { opacity: 0.6; cursor: default; }

/* ----------------------------------------------------------
   Dark mode overrides
   ---------------------------------------------------------- */
html.dark .ac-shell .card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
