@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

/* ====================================================
   GLOBAL CSS VARIABLES & ADMIN COMPATIBILITY
   ==================================================== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(22, 30, 46, 0.75);
  --bg-card-hover: rgba(30, 41, 64, 0.9);
  --bg-glass: rgba(17, 24, 39, 0.7);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --border-glow: rgba(59, 130, 246, 0.35);

  --accent-blue: #1e56ed;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --whatsapp-green: #25d366;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Grotesk', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ====================================================
   LIGHT THEME 3-STEP USER INTERFACE (MATCHING SCREENSHOTS)
   ==================================================== */
body.sp-app-body {
  font-family: var(--font-main);
  background-color: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* 1. SOLID ROYAL BLUE HEADER (Matching Screenshot 1, 2, 3) */
.sp-top-banner {
  background-color: #1e56ed;
  color: #ffffff;
  padding: 16px 28px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(30, 86, 237, 0.22);
}

.banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.9;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.staff-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
}

.online-indicator {
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.banner-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.banner-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.9);
}

/* 2. MAIN CONTAINER */
.sp-main-content {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 60px;
  flex: 1;
}

/* 3. STEP HEADINGS & BACK NAVIGATION */
.step-nav-bar {
  margin-bottom: 18px;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.nav-back-link:hover {
  color: #1e56ed;
  transform: translateX(-3px);
}

.view-header {
  margin-bottom: 26px;
}

.view-header.text-center {
  text-align: center;
}

.step-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.step-desc {
  color: #64748b;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.step-subtitle {
  font-size: 1.15rem;
  color: #475569;
}

.highlight-code {
  color: #1e56ed;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 1.25rem;
}

.city-subtext {
  color: #64748b;
  font-weight: 500;
  font-size: 0.95rem;
  margin-left: 6px;
}

.sector-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 2.2rem;
  font-weight: 800;
}

.route-arrow {
  color: #94a3b8;
  font-weight: 400;
}

.step-count {
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 4px;
}

/* 4. SEARCH FILTER BOX */
.search-wrap {
  margin-bottom: 24px;
  max-width: 480px;
}

.view-header.text-center ~ .search-wrap {
  margin-left: auto;
  margin-right: auto;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input-box:focus-within {
  border-color: #1e56ed;
  box-shadow: 0 0 0 3px rgba(30, 86, 237, 0.15);
}

.search-input-box input {
  border: none;
  outline: none;
  background: none;
  width: 100%;
  font-size: 0.92rem;
  color: #0f172a;
  font-family: var(--font-main);
}

.search-input-box input::placeholder {
  color: #94a3b8;
}

.search-icon {
  color: #94a3b8;
  flex-shrink: 0;
}

/* 5. CITY CARDS (Origin & Destination - Matching Screenshot 1 & 2) */
.city-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.city-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.city-card:hover {
  border-color: #1e56ed;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 86, 237, 0.12);
}

.city-card:active {
  transform: translateY(-1px);
}

.city-card .city-code {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.city-card .city-name {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 12px;
}

.city-card .city-meta-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e56ed;
  background: rgba(30, 86, 237, 0.08);
  border: 1px solid rgba(30, 86, 237, 0.18);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* 6. FILTER TOOLBAR CARD (Matching Screenshot 3) */
.filter-toolbar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.filter-toolbar-card .search-cell {
  flex: 2;
  min-width: 260px;
}

.filter-toolbar-card .filter-cell {
  flex: 1;
  min-width: 150px;
}

.filter-dropdown {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  font-family: var(--font-main);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-dropdown:focus {
  border-color: #1e56ed;
  box-shadow: 0 0 0 3px rgba(30, 86, 237, 0.15);
}

/* 7. FLIGHTS RESULTS TABLE (Matching Screenshot 3) */
.table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.flights-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.flights-table th {
  background-color: #f8fafc;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.flights-table th.book-head {
  text-align: center;
  width: 54px;
}

.flights-table td {
  padding: 12px 12px;
  font-size: 0.86rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: nowrap;
}

.flights-table td.book-cell {
  text-align: center;
  width: 54px;
}
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: nowrap;
}

.flights-table tr:hover td {
  background-color: #f8fafc;
}

.airline-name-cell {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92rem;
}

.flight-code-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #334155;
}

.fare-price-cell {
  font-weight: 800;
  font-size: 1.15rem;
  color: #1e56ed;
}

.seats-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.25);
}

.seats-badge.urgent {
  background: #fef2f2;
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.time-updated-cell {
  color: #64748b;
  font-size: 0.8rem;
  font-family: -apple-system, BlinkMacSystemFont, monospace;
}

/* WhatsApp Book Button (Matching Screenshot 3) */
.whatsapp-book-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #25d366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.whatsapp-book-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.55);
}

.whatsapp-book-btn svg {
  fill: #ffffff;
}

/* 8. LOADING & EMPTY STATES */
.sp-loading-box, .sp-error-box, .no-results-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
}

.spinner-ring {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: #1e56ed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-label {
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
}

.no-res-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.no-res-subtitle {
  color: #64748b;
  font-size: 0.9rem;
}

.sp-retry-btn {
  margin-top: 16px;
  background: #1e56ed;
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* 9. FOOTER */
.sp-footer {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 24px 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ====================================================
   MOBILE RESPONSIVENESS
   ==================================================== */
@media (max-width: 768px) {
  .banner-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .step-title {
    font-size: 1.7rem;
  }

  .sector-title {
    font-size: 1.7rem;
  }

  .city-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .city-card {
    padding: 20px 14px;
  }

  .filter-toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-toolbar-card .search-cell,
  .filter-toolbar-card .filter-cell {
    width: 100%;
  }

  .flights-table th, .flights-table td {
    padding: 12px 14px;
    font-size: 0.82rem;
  }
}

/* ====================================================
   ADMIN & UTILITY CLASSES (PRESERVED FOR ADMIN.HTML)
   ==================================================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.navbar { position: sticky; top: 0; z-index: 100; background: var(--bg-glass); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-subtle); padding: 16px 0; }
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.brand-title { font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.brand-tag { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.nav-links { display: flex; align-items: center; gap: 14px; }
.nav-btn { padding: 9px 18px; font-size: 0.88rem; font-weight: 600; border-radius: var(--radius-md); text-decoration: none; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 8px; }
.nav-btn-secondary { background: rgba(255, 255, 255, 0.05); color: #f8fafc; border: 1px solid var(--border-subtle); }
.nav-btn-primary { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); color: #fff; }
.input-control { background: rgba(10, 14, 23, 0.7); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px 14px; color: #fff; font-size: 0.92rem; outline: none; width: 100%; }

/* ====================================================
   ADMIN CONSOLE DEDICATED DARK THEME
   ==================================================== */
body.admin-dark-theme {
  background-color: #0a0e17 !important;
  color: #f8fafc !important;
  font-family: var(--font-main, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body.admin-dark-theme,
.admin-dark-theme {
  --text-main: #f8fafc !important;
  --text-muted: #94a3b8 !important;
  --text-dim: #64748b !important;
  --bg-primary: #0a0e17 !important;
  --bg-secondary: #111827 !important;
  --bg-card: #111827 !important;
  --bg-card-hover: #1e293b !important;
  --border-subtle: rgba(255, 255, 255, 0.09) !important;
}

.admin-dark-theme .navbar {
  background: rgba(10, 14, 23, 0.9) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.admin-dark-theme .brand-title {
  color: #f8fafc !important;
}

.admin-dark-theme .panel {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  color: #f8fafc !important;
}

.admin-dark-theme .panel-title {
  color: #f1f5f9 !important;
  font-weight: 700;
}

.admin-dark-theme p, 
.admin-dark-theme span, 
.admin-dark-theme label {
  color: inherit;
}

.admin-dark-theme .textarea-control,
.admin-dark-theme .input-control,
.admin-dark-theme select {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-md);
  padding: 12px;
  color: #f8fafc !important;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-dark-theme .textarea-control:focus,
.admin-dark-theme .input-control:focus,
.admin-dark-theme select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
  background: #131d31 !important;
}

.admin-dark-theme .code-box {
  background: #05080f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #34d399 !important;
  border-radius: 8px;
}

.admin-dark-theme .preset-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  transition: all 0.2s ease;
}

.admin-dark-theme .preset-btn:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #3b82f6 !important;
  color: #60a5fa !important;
}

.admin-dark-theme table {
  color: #f8fafc !important;
}

.admin-dark-theme th {
  color: #94a3b8 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.admin-dark-theme td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}

.admin-dark-theme .nav-btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  transition: all 0.2s ease;
}

.admin-dark-theme .nav-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

