/* ═══════════════════════════════════════════════════════════════
   GPS Announcer — Global Stylesheet
   Mobile-first, premium design system
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Primary palette */
  --clr-primary: #1E88E5;
  --clr-primary-hover: #1976D2;
  --clr-primary-light: #BBDEFB;
  --clr-primary-dark: #0D47A1;

  /* Neutrals */
  --clr-bg: #f0f2f5;
  --clr-surface: #ffffff;
  --clr-surface-alt: #f5f7fa;
  --clr-border: #e0e3e8;
  --clr-input-bg: #f0f2f5;

  /* Text */
  --clr-text: #1a1a2e;
  --clr-text-secondary: #5f6368;
  --clr-text-muted: #9aa0a6;

  /* Header / Footer */
  --clr-header: #1a1a2e;
  --clr-footer: #e8eaed;

  /* Feedback */
  --clr-success: #34A853;
  --clr-error: #EA4335;
  --clr-warning: #FBBC04;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.7rem;
  --font-size-sm: 0.8rem;
  --font-size-base: 0.95rem;
  --font-size-md: 1.05rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.8rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ── Dark Theme ────────────────────────────────────────────── */
body.theme-dark {
  /* Neutrals */
  --clr-bg: #0f1117;
  --clr-surface: #1a1d27;
  --clr-surface-alt: #22263a;
  --clr-border: #2e3347;
  --clr-input-bg: #22263a;

  /* Text */
  --clr-text: #e8eaf0;
  --clr-text-secondary: #9aa3b8;
  --clr-text-muted: #5a6282;

  /* Header / Footer */
  --clr-header: #0d0f17;
  --clr-footer: #13151f;

  /* Primary (slightly lighter for dark bg readability) */
  --clr-primary: #4ba3f5;
  --clr-primary-hover: #2196f3;
  --clr-primary-light: rgba(75, 163, 245, 0.15);
  --clr-primary-dark: #1565c0;

  /* Shadows — more visible on dark surfaces */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
}

/* ── Base ──────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition-base), color var(--transition-base);
}

/* ── Page Layout ───────────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

/* ── Header ────────────────────────────────────────────────── */
.header {
  background: var(--clr-header);
  color: #ffffff;
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header__title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.header--with-back {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header__back-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.header__back-btn:hover {
  background: rgba(255,255,255,0.15);
}

.header--with-back .header__title {
  flex: 1;
  text-align: center;
  margin-right: 36px; /* balance the back button */
}

/* ── Content ───────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: var(--space-lg);
  animation: fadeInUp 0.4s ease;
}

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

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--clr-footer);
  color: var(--clr-text-secondary);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-top: 1px solid var(--clr-border);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: var(--font-size-base);
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.3;
  width: 100%;
  min-height: 48px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--clr-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--clr-primary-hover);
  box-shadow: 0 4px 16px rgba(30, 136, 229, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #b0bec5;
  color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
  background: #90a4ae;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--clr-error);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 67, 53, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: #D32F2F;
  box-shadow: 0 4px 16px rgba(234, 67, 53, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--clr-primary);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  min-height: 36px;
  border-radius: var(--radius-md);
  width: auto;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Large menu buttons (homepage) ─────────────────────────── */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary);
  color: #ffffff;
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-xl);
  padding: 28px var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  width: 100%;
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.3);
}

.menu-btn:hover {
  background: var(--clr-primary-hover);
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.45);
  transform: translateY(-2px);
}

.menu-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

/* ── GPS Status Box ────────────────────────────────────────── */
.gps-status {
  text-align: center;
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.gps-status__label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--clr-text-secondary);
  margin-bottom: var(--space-xs);
}

.gps-status__value {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--clr-text);
  line-height: 1.4;
}

.gps-status__value.valid {
  color: var(--clr-success);
}

.gps-status__value.invalid {
  color: var(--clr-error);
}

.gps-status__coords {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  font-family: 'Courier New', monospace;
  margin-top: var(--space-xs);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card__header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--clr-border);
  font-weight: 700;
  font-size: var(--font-size-md);
  text-align: center;
}

.card__body {
  padding: var(--space-lg);
}

/* ── Form Elements ─────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--space-sm);
}

.form-control {
  width: 100%;
  padding: 12px var(--space-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--clr-text);
  background: var(--clr-input-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  background: var(--clr-surface);
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

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

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8.825L.35 3.175 1.05 2.475 6 7.425 10.95 2.475 11.65 3.175z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* ── Range Slider ──────────────────────────────────────────── */
.range-group {
  margin-bottom: var(--space-lg);
}

.range-group label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--space-sm);
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.range-wrapper input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--clr-border);
  outline: none;
  transition: background var(--transition-fast);
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--clr-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(30, 136, 229, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(30, 136, 229, 0.5);
}

.range-wrapper input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--clr-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(30, 136, 229, 0.4);
}

.range-value {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--clr-primary);
  background: var(--clr-primary-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* ── Input with inline button ──────────────────────────────── */
.input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.input-group .form-control {
  flex: 1;
}

.input-group .btn {
  width: auto;
  white-space: nowrap;
}

/* ── Form Actions ──────────────────────────────────────────── */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ── List Items (for CRUD list view) ──────────────────────── */
.list-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.list-item {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-fast);
  border: 1px solid var(--clr-border);
  animation: fadeInUp 0.3s ease backwards;
}

.list-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-primary-light);
}

.list-item__number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--clr-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: var(--font-size-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item__info {
  flex: 1;
  min-width: 0;
}

.list-item__title {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item__subtitle {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
}

.list-item__actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--clr-text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__text {
  font-size: var(--font-size-base);
  font-weight: 500;
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: calc(100% - 32px);
  max-width: 480px;
  pointer-events: none;
}

.toast {
  padding: 14px var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.35s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toast--success {
  background: var(--clr-success);
  color: #ffffff;
}

.toast--error {
  background: var(--clr-error);
  color: #ffffff;
}

.toast--removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

/* ── Modal / Overlay ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hiding {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.modal {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
  text-align: center;
}

.modal-overlay.hiding .modal {
  animation: modalOut 0.2s ease forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalOut {
  to { opacity: 0; transform: scale(0.9) translateY(10px); }
}

.modal__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.modal__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.modal__text {
  font-size: var(--font-size-sm);
  color: var(--clr-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.modal__actions {
  display: flex;
  gap: var(--space-md);
}

.modal__actions .btn {
  flex: 1;
}

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.spinner--lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  color: var(--clr-text-muted);
  font-size: var(--font-size-sm);
}

/* ── Section title (used in form pages) ────────────────────── */
.section-title {
  font-size: var(--font-size-md);
  font-weight: 700;
  text-align: center;
  padding: var(--space-md) 0;
  color: var(--clr-text);
}

/* ── Floating Action Button ────────────────────────────────── */
.fab {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(30, 136, 229, 0.4);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(30, 136, 229, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* ── Modal Form (CRUD popup) ──────────────────────────────── */
.modal-form-overlay {
  align-items: flex-start;
  padding: var(--space-md);
  overflow-y: auto;
}

.modal--form {
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - var(--space-xl));
  margin: auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: var(--space-lg);
  flex-shrink: 0;
}

.modal__form-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin: 0;
}

.modal__close-btn {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
}

.modal__close-btn:hover {
  background: var(--clr-surface-alt);
  color: var(--clr-error);
}

.modal__form-body {
  overflow-y: auto;
  flex: 1;
  padding-right: var(--space-xs);
}

/* Scrollbar styling for modal form body */
.modal__form-body::-webkit-scrollbar {
  width: 6px;
}

.modal__form-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal__form-body::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 3px;
}

.modal__form-body::-webkit-scrollbar-thumb:hover {
  background: var(--clr-text-muted);
}

/* ── Utility ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--clr-text-muted); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-md { gap: var(--space-md); }
.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (min-width: 600px) {
  .content {
    padding: var(--space-xl);
  }
}

/* ── Voice Preview Panel (route-stop form) ──────────────────── */
.voice-preview-panel {
  margin-bottom: var(--space-lg);
  border: 2px solid var(--clr-primary-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-surface-alt);
  animation: fadeInUp 0.25s ease;
}

.voice-preview-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, rgba(30,136,229,0.12), rgba(30,136,229,0.05));
  border-bottom: 1px solid var(--clr-primary-light);
}

.voice-preview-panel__icon {
  font-size: 1.1rem;
}

.voice-preview-panel__label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.voice-preview-panel__meta {
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  margin-left: auto;
  text-align: right;
  line-height: 1.3;
}

.voice-preview-panel__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.voice-preview-panel__actions {
  display: flex;
  gap: var(--space-sm);
}

.voice-preview-panel__actions .btn {
  flex: 1;
  min-height: 42px;
  font-size: var(--font-size-sm);
}

.btn--play {
  background: transparent;
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
}

.btn--play:hover:not(:disabled) {
  background: var(--clr-primary);
  color: #ffffff;
}

.btn--stop {
  background: transparent;
  color: var(--clr-text-secondary);
  border: 2px solid var(--clr-border);
}

.btn--stop:hover:not(:disabled) {
  background: var(--clr-border);
  color: var(--clr-text);
}

/* ── Search Bar ───────────────────────────────────────────── */
.search-bar {
  margin-bottom: var(--space-lg);
}

.search-bar__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar__icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.55;
  z-index: 1;
}

.search-bar__input {
  width: 100%;
  padding: 13px 42px 13px 42px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--clr-text);
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-full);
  outline: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.search-bar__input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15), var(--shadow-md);
}

.search-bar__input::placeholder {
  color: var(--clr-text-muted);
  font-weight: 400;
}

.search-bar__clear {
  position: absolute;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  background: var(--clr-surface-alt);
  color: var(--clr-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.search-bar__clear:hover {
  background: var(--clr-error);
  color: #ffffff;
}

/* ── Search Results Header ────────────────────────────────── */
.search-results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-xs);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--clr-text-secondary);
}

/* ── Search Result Detail Cards ───────────────────────────── */
.search-result-card {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  animation: fadeInUp 0.3s ease backwards;
  transition: all var(--transition-fast);
}

.search-result-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--clr-primary-light);
}

.search-result-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(30,136,229,0.08), rgba(30,136,229,0.02));
  border-bottom: 1px solid var(--clr-border);
}

.search-result-card__title {
  font-weight: 700;
  font-size: var(--font-size-md);
  color: var(--clr-text);
}

.search-result-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.search-result-card__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.search-result-card__label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--clr-text-secondary);
  min-width: 110px;
}

.search-result-card__value {
  color: var(--clr-text);
  font-weight: 500;
  word-break: break-word;
}

.search-result-card__footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  align-items: center;
}

.search-result-card__no-voice {
  flex: 1;
  font-size: var(--font-size-xs);
  color: var(--clr-text-muted);
  font-style: italic;
}

.search-result-card__footer .btn {
  min-height: 36px;
  font-size: var(--font-size-xs);
}
