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

:root {
  /* Colors - Calm Almosafer Inspired Palette */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F1F5F9;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-inverse: #ffffff;
  
  --border-light: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --primary: #0B132B; /* Deep Navy */
  --primary-hover: #1e293b;
  
  --accent: #E4223A; /* Brand Coral */
  --accent-hover: #c51d31;
  --accent-light: #fff0f0;

  --header-bg: rgba(255, 255, 255, 0.85);
  --hero-gradient-1: #0B132B;
  --hero-gradient-2: #4A5568;
  
  --danger: #e4223a;
  --danger-light: #fef2f2;
  
  --success: #059669;
  --success-light: #ecfdf5;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.04), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.03);
  --shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.08);

  /* Typography */
  --font-arabic: 'Almarai', sans-serif;
  --font-english: 'Outfit', sans-serif;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark-mode {
  --bg-app: #0B132B;
  --bg-surface: #141E3A;
  --bg-surface-hover: #1C2A50;
  
  --text-main: #FFFFFF;
  --text-muted: #A0AEC0;
  --text-inverse: #0B132B;
  
  --border-light: #2D3748;
  --border-strong: #4A5568;
  
  --primary: #60A5FA; /* Bright Blue for better contrast */
  --primary-hover: #93C5FD;
  
  --accent: #FF6B6B; /* Brighter Coral for Dark Mode */
  --accent-hover: #FA5252;
  --accent-light: rgba(255, 107, 107, 0.15);
  
  --danger: #FF6B6B;
  --danger-light: rgba(255, 107, 107, 0.15);
  
  --success: #34D399;
  --success-light: rgba(52, 211, 153, 0.15);

  --header-bg: rgba(11, 19, 43, 0.85);
  --hero-gradient-1: #FFFFFF;
  --hero-gradient-2: #94A1B2;
}

html[lang="ar"] { font-family: var(--font-arabic); }
html[lang="en"] { font-family: var(--font-english); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }

body, .app-header, .home-card, .form-control, .modal-content, .viewer-sidebar, .timeline-item, .docs-list li, .doc-card, .mobile-bottom-nav, .mobile-nav-item, .card {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body { 
  background: var(--bg-app); 
  color: var(--text-main); 
  font-family: var(--font-arabic); 
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased; 
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ================== TYPOGRAPHY ================== */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-main); line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { color: var(--text-muted); font-size: 0.95rem; }

/* ================== LAYOUT ================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.max-w-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  width: 100%;
  box-sizing: border-box;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================== APP SHELL ================== */
.app-header {
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  max-width: 1000px;
  margin: 0 auto;
}

.app-branding {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.app-branding h1 { font-size: 1.125rem; font-weight: 700; }
.brand-icon { color: var(--primary); width: 24px; height: 24px; }

.nav-controls { display: flex; align-items: center; gap: var(--space-2); }

/* ================== BUTTONS ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  text-decoration: none;
  min-height: 40px;
}

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

.btn i { width: 18px; height: 18px; }

.btn-primary { 
  background: linear-gradient(135deg, var(--accent), #FF8E53); 
  color: var(--text-inverse); 
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  border: none;
}
.btn-primary:hover { 
  background: linear-gradient(135deg, var(--accent-hover), #fa5252);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-secondary { background: var(--bg-surface); color: var(--text-main); border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg-surface-hover); border-color: var(--border-strong); }

.btn-outline { background: transparent; color: var(--text-main); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-surface-hover); }

.btn-accent { background: var(--accent); color: var(--text-inverse); }
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(254, 92, 54, 0.2); }

.btn-danger { background: var(--danger-light); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #fecaca; }

.btn-icon-only { padding: 0.5rem; border-radius: var(--radius-full); aspect-ratio: 1; }

/* ================== VIEWS ================== */
.app-view {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  padding: var(--space-8) 0;
  flex: 1;
}

.app-view.active-view {
  display: block;
  animation: fadeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ================== HOME HERO ================== */
.hero-section {
  text-align: center;
  margin-bottom: var(--space-12);
  padding-top: var(--space-6);
}

.hero-section .unified-section-title {
  /* Inherits clamp font-size from .unified-section-title */
  background: linear-gradient(to right, var(--hero-gradient-1), var(--hero-gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[lang="ar"] .hero-section .unified-section-title {
    background: linear-gradient(to left, var(--hero-gradient-1), var(--hero-gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section .unified-section-subtitle { max-width: 500px; margin-left: auto; margin-right: auto; line-height: 1.7; }

/* ================== GRID CARDS ================== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) { .home-grid { grid-template-columns: 1fr 1fr; } }

.home-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: right;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}
html[lang="en"] .home-card { text-align: left; }

.home-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(255, 107, 107, 0.15);
  transition: all 0.3s ease;
  border-color: var(--border-strong);
}

.card-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  color: var(--primary);
  transition: var(--transition);
}

.home-card:hover .card-icon-wrapper { background: var(--primary); color: var(--text-inverse); }

.home-card h3 { font-size: 1.25rem; margin-bottom: var(--space-2); }
.home-card p { flex-grow: 1; margin-bottom: var(--space-4); font-size: 0.9rem; }

.card-action-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.card-action-text i { width: 16px; height: 16px; transition: var(--transition); }
.home-card:hover .card-action-text i { transform: translateX(-4px); }
html[lang="en"] .home-card:hover .card-action-text i { transform: translateX(4px); }

/* ================== STEPS INDICATOR ================== */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-8);
  background: transparent;
}

.step-item { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); transition: var(--transition); }
.step-item.active { color: var(--primary); }

.step-number {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.step-item.active .step-number { background: var(--primary); border-color: var(--primary); color: var(--text-inverse); }
.step-item.completed .step-number { background: var(--success); border-color: var(--success); color: var(--text-inverse); }

.step-line { width: 40px; height: 1px; background: var(--border-strong); margin: 0 var(--space-3); }

/* ================== FORMS & INPUTS ================== */
.setup-step {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  display: none;
}
.setup-step.active { display: block; animation: viewFadeIn 0.3s ease-out; }

.step-header { margin-bottom: var(--space-6); }
.step-header p, .mb-8 p { margin-bottom: 20px; }

.form-group { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--text-main); display: flex; align-items: center; gap: var(--space-2); }
.form-group label i { width: 16px; height: 16px; color: var(--text-muted); }
.required { color: var(--danger); }

.form-control {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.3s ease;
  width: 100%;
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15) !important;
  background: var(--bg-surface);
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

.form-actions { 
  display: flex; 
  flex-direction: column-reverse; 
  gap: var(--space-3); 
  margin-top: var(--space-6); 
}
@media (min-width: 640px) {
  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.readonly-input { background: #f4f4f5 !important; cursor: not-allowed; color: var(--text-muted); border-style: dashed; }

/* ================== CARDS (Cities/Documents) ================== */
.list-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
  transition: var(--transition);
}
@media (min-width: 640px) { .list-card { flex-direction: row; align-items: center; justify-content: space-between; } }
.list-card:hover { 
  border-color: var(--border-strong); 
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(255, 107, 107, 0.15);
  transition: all 0.3s ease;
}

.list-card-info { display: flex; flex-direction: column; gap: var(--space-1); }
.list-card-title { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: var(--space-2); }
.list-card-title i { color: var(--text-muted); width: 18px; height: 18px; }
.list-card-subtitle { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: var(--space-2); }

.list-card-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ================== TIMELINE ================== */
.timeline-container { position: relative; padding: var(--space-4) 0; margin-top: var(--space-6); }
.timeline-container::before {
  content: ''; position: absolute; top: 0; bottom: 0; right: 24px; width: 2px; background: var(--border-light);
}
html[lang="en"] .timeline-container::before { right: auto; left: 24px; }

.timeline-day-group { margin-bottom: var(--space-8); }
.timeline-day-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); position: relative; z-index: 2; }
.timeline-badge { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-strong); font-weight: 700; font-size: 0.8rem; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); box-shadow: none; }
.timeline-date { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; }

.timeline-item {
  position: relative;
  margin-right: 48px;
  width: calc(100% - 48px);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-right: 3px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  padding-right: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: var(--transition);
}
.timeline-item::before {
  content: '';
  position: absolute;
  right: -9px;
  top: 15px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 2;
}
html[lang="en"] .timeline-item { 
  margin-right: 0; 
  margin-left: 48px; 
  border-right: 1px solid var(--border-light); 
  border-left: 2px dashed var(--border-strong); 
  padding-right: var(--space-4); 
  padding-left: 15px; 
}
html[lang="en"] .timeline-item::before { right: auto; left: -7px; }
.timeline-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateX(-2px); }
html[lang="en"] .timeline-item:hover { transform: translateX(2px); }

.badge-premium {
  background: #FF8E53;
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-block;
}

@media (min-width: 640px) { .timeline-item { flex-direction: row; justify-content: space-between; align-items: flex-start; } }

.timeline-item-content { flex: 1; min-width: 0; }
.timeline-time { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: var(--space-1); margin-bottom: var(--space-1); }
.timeline-time i, .timeline-time svg { width: 14px; height: 14px; }
.timeline-title { font-weight: 700; font-size: 1.05rem; margin-bottom: var(--space-1); word-break: break-word; }
.timeline-cost { display: inline-block; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; padding: 0; margin-bottom: var(--space-2); }
.timeline-notes { font-size: 0.85rem; color: var(--text-muted); background: var(--bg-app); padding: var(--space-2); border-radius: var(--radius-sm); margin-top: var(--space-2); word-break: break-word; }

/* ================== VIEWER SIDEBAR/LAYOUT ================== */
.viewer-layout { display: flex; flex-direction: column; gap: var(--space-6); }
@media (min-width: 900px) { .viewer-layout { flex-direction: row; align-items: flex-start; } }

.viewer-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
  min-width: 280px;
  display: none;
}
@media (min-width: 900px) { .viewer-sidebar { display: block; } }

.viewer-main { flex: 1; width: 100%; }

/* Mobile Bottom Nav Bar (New UX) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: space-around;
  padding: var(--space-2) 0;
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -10px 25px -5px rgba(11, 19, 43, 0.05);
}
@media (min-width: 900px) { .mobile-bottom-nav { display: none; } }

.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: 0.7rem; font-weight: 600;
  text-decoration: none; padding: 4px 12px; border-radius: var(--radius-md);
  transition: var(--transition);
  background: transparent; border: none; font-family: inherit; cursor: pointer;
}
.mobile-nav-item i { width: 22px; height: 22px; }
/* Bottom Nav Active State */
.mobile-nav-item.active,
.mobile-bottom-nav .active,
.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav a.active {
    background: transparent !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    color: var(--accent) !important; 
    font-weight: 700 !important;
}
.mobile-nav-item:active { background: var(--bg-surface-hover); transform: scale(0.95); }

/* Viewer Date Slider */
.dates-slider-wrapper {
  display: flex; align-items: center; gap: var(--space-2);
  margin: var(--space-6) 0; background: var(--bg-surface);
  border: 1px solid var(--border-light); padding: var(--space-2);
  border-radius: var(--radius-full); box-shadow: var(--shadow-sm);
}

.dates-slider {
  display: flex; overflow-x: auto; scroll-behavior: smooth; gap: var(--space-2);
  padding: 0 var(--space-2); flex: 1; scrollbar-width: none;
}
.dates-slider::-webkit-scrollbar { display: none; }

.date-slide-btn {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-full);
  border: none; background: transparent; cursor: pointer; transition: var(--transition);
  color: var(--text-muted);
}
.date-slide-btn.active { background: var(--primary); color: var(--text-inverse); box-shadow: var(--shadow-sm); }
.date-slide-btn .day-num { font-weight: 700; font-size: 0.9rem; }
.date-slide-btn .date-lbl { font-size: 0.75rem; opacity: 0.8; }

/* ================== MODALS ================== */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none; transition: var(--transition);
  padding: var(--space-4);
}
.modal-backdrop.active { opacity: 1; pointer-events: auto; }

.modal-container {
  background: var(--bg-surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 500px; box-shadow: var(--shadow-float);
  transform: translateY(20px) scale(0.95); transition: var(--transition);
  display: flex; flex-direction: column; max-height: 90vh;
}
.modal-backdrop.active .modal-container { transform: translateY(0) scale(1); }

.modal-header {
  padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.25rem; }
.btn-close {
  background: var(--bg-app); border: none; width: 32px; height: 32px;
  border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: var(--transition);
}
.btn-close:hover { background: var(--border-light); color: var(--text-main); }

.modal-body { padding: var(--space-6); overflow-y: auto; }
.modal-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: var(--space-3); background: var(--bg-app); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }

/* ================== EMPTY STATES ================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(248, 250, 252, 0.5);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  margin: 1.5rem 0;
  transition: all 0.3s ease;
}
.empty-state:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.empty-state i { width: 48px; height: 48px; color: var(--border-strong); margin-bottom: var(--space-4); }
.empty-state h4 { color: var(--text-main); font-size: 1.1rem; margin-bottom: var(--space-1); }

/* ================== UTILITIES ================== */
.hidden { display: none !important; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Print Grid Layout */
.print-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  width: 100%;
  box-sizing: border-box;
  align-items: start;
  overflow: hidden;
}

@media (min-width: 768px) {
  .print-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* FIXES */
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; min-height: 32px; }
.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: var(--text-inverse); }
.btn-outline-success { background: transparent; color: var(--success); border-color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: var(--text-inverse); }
.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: var(--text-inverse); }
svg { pointer-events: none; }
.btn:empty { display: none; }
.btn i { display: flex; align-items: center; justify-content: center; }


.btn svg { width: 18px; height: 18px; pointer-events: none; }
.card-icon-wrapper svg { width: 24px; height: 24px; pointer-events: none; }
.card-action-text svg { width: 16px; height: 16px; transition: var(--transition); pointer-events: none; }

/* Status Colors */
.color-success { color: var(--success); font-weight: 600; }
.color-warning { color: #f59e0b; font-weight: 600; }
.color-danger { color: var(--danger); font-weight: 600; }

/* Autocomplete Suggestions */
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-light);
  text-align: right;
}
html[lang="en"] .suggestion-item {
  text-align: left;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--bg-surface-hover);
  color: var(--primary);
}

.suggestion-item i, .suggestion-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Tab Buttons styling */
.tab-btn:hover {
  color: var(--primary) !important;
}
.tab-btn.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

@media (max-width: 899px) {
  .app-container {
    padding-bottom: 80px; /* Safe padding for mobile bottom nav bar */
  }
}

/* Viewer steps toggles */
.viewer-step {
  display: none !important;
}
.viewer-step.active {
  display: block !important;
  animation: viewFadeIn 0.3s ease-out;
}

/* Modal flex distribution for long forms and scrollable modal-body */
.modal-container form {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
  width: 100%;
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}
.modal-header, .modal-footer {
  flex-shrink: 0;
}

/* Share Dropdown Wrapper & Menu */
.share-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.share-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  z-index: 100;
  min-width: 160px;
  overflow: hidden;
  animation: viewFadeIn 0.2s ease-out;
}
html[dir="rtl"] .share-menu {
  left: auto;
  right: 50%;
  transform: translateX(50%) translateY(-8px);
}

.share-dropdown-wrapper.active .share-menu {
  display: block;
}

.share-menu-item {
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-main);
  text-align: right;
  transition: var(--transition);
  font-family: inherit;
}
html[lang="en"] .share-menu-item {
  text-align: left;
}

.share-menu-item:hover {
  background: var(--bg-surface-hover);
}

.share-menu-item i, .share-menu-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Print Page Document Row Styles */
.print-item-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  transition: var(--transition);
}
@media (min-width: 640px) {
  .print-item-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.print-item-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.print-item-row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.print-item-row-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}
.print-item-row-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.print-item-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Simulated Paper Preview in Modal */
.simulated-paper-preview {
  background: #ffffff;
  color: #000000;
  padding: 30px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  margin: 15px auto;
  font-family: var(--font-arabic);
}
.simulated-paper-preview h1,
.simulated-paper-preview h2,
.simulated-paper-preview h3,
.simulated-paper-preview h4 {
  color: #000000;
}

/* Print-specific stylesheet overlay */
/* ====== 5. DOCUMENT PRINT CONTENT STYLES (Global) ====== */
.print-original-image-only {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
}
.print-original-image-only img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.print-report-header {
    text-align: center;
    border-bottom: 3px double #000;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
.print-report-header h1 {
    font-size: 24pt;
    font-weight: 800;
    margin-bottom: 5px;
}
.print-report-header p {
    font-size: 12pt;
    color: #333;
}
.print-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    background-color: #f8fafc !important;
    border: 1px solid #ccc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.print-meta-table td {
    padding: 10px;
    font-size: 11pt;
    border: none;
}
.print-section-title {
    font-size: 14pt;
    font-weight: 700;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
}
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}
.print-table th, .print-table td {
    border: 1px solid #999;
    padding: 8px 10px;
    font-size: 10pt;
    text-align: inherit;
}
.print-table th {
    background-color: #eee !important;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.print-doc-notes {
    background-color: #f8fafc !important;
    border-right: 4px solid #94a3b8;
    padding: 15px;
    font-style: italic;
    font-size: 11pt;
    margin-bottom: 20px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.print-page-break {
    page-break-after: always;
    break-after: page;
}
.timeline-item, .print-table th, .print-section-title {
    border-color: #E4223A !important;
}
.timeline-item::before, .timeline-badge, .badge-premium {
    background: #E4223A !important;
}

/* ===== Phase 17: Nuclear Print DOM Swap Rules ===== */
@media print {
    /* Reset Body */
    html, body {
        height: auto !important;
        overflow: visible !important;
        background-color: #FFFFFF !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* The Clone gets full authority */
    #temp-print-clone {
        display: block !important;
        width: 100% !important;
    }

    /* Prevent page breaks inside tables */
    tr, td, th, .timeline-item {
        page-break-inside: avoid !important;
    }

    /* Explicitly hide any floating UI that might have sneaked into the clone */
    #temp-print-clone .floating-ai-btn, 
    #temp-print-clone .offline-badge, 
    #temp-print-clone button, 
    #temp-print-clone .btn,
    #temp-print-clone .toast-container {
        display: none !important;
    }
}

/* ================== SCREEN PRINT AREA HIDING ================== */
#print-report-area {
  display: none;
}

/* ================== MOBILE LAYOUT FIXES (Error 1) ================== */
@media (max-width: 639px) {

}

/* ================== MOBILE SIDEBAR DRAWER (Error 3) ================== */
@media (max-width: 899px) {
  .viewer-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: var(--bg-surface);
    margin: 0;
    border-radius: 0;
    border: none;
    padding: var(--space-6);
    overflow-y: auto;
    animation: slideInUp 0.3s ease-out;
  }
  .viewer-sidebar.active {
    display: block !important;
  }
  .viewer-sidebar .btn-close.hidden {
    display: flex !important;
  }
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ================== AI ADVISOR DASHBOARD WIDGETS ================== */
.readiness-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .readiness-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
  }
}
.readiness-gauge-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}
.readiness-ring {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.readiness-ring svg {
  transform: rotate(-90deg);
  width: 90px;
  height: 90px;
}
.readiness-ring circle {
  fill: none;
  stroke-width: 8;
}
.readiness-ring .ring-bg {
  stroke: var(--border-light);
}
.readiness-ring .ring-fill {
  stroke: var(--accent);
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
}
.readiness-score-text {
  position: absolute;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}
.readiness-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.readiness-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
}
.readiness-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.ai-alerts-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}
html[dir="ltr"] .ai-alerts-container {
  padding-right: 0;
  padding-left: 4px;
}
.ai-alert-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.85rem;
  animation: viewFadeIn 0.3s ease-out;
}
.ai-alert-item.severity-critical {
  background: #fef2f2;
  border-color: #fee2e2;
  color: #991b1b;
}
.ai-alert-item.severity-high {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
}
.ai-alert-item.severity-medium {
  background: #eff6ff;
  border-color: #dbeafe;
  color: #1e40af;
}
.ai-alert-item.severity-low {
  background: #f4f4f5;
  border-color: #e4e4e7;
  color: #3f3f46;
}
.ai-alert-icon {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
}
.ai-alert-icon svg {
  width: 16px;
  height: 16px;
}
.ai-alert-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.ai-alert-title {
  font-weight: 700;
}
.ai-alert-desc {
  opacity: 0.9;
}
.ai-alert-action {
  font-weight: 700;
  text-decoration: underline;
  margin-top: 2px;
  cursor: pointer;
  align-self: flex-start;
}

/* ================== FLOATING AI CHAT TRIGGER & DRAWER ================== */
.btn-ai-float {
  position: fixed;
  bottom: 120px;
  right: 20px;
  z-index: 990;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-ai-float:hover {
  transform: scale(1.05);
  background: #1d4ed8;
}
html[dir="rtl"] .btn-ai-float {
  right: auto;
  left: 20px;
}
@media (min-width: 900px) {
  .btn-ai-float {
    bottom: 20px;
  }
}
.btn-ai-float svg {
  width: 26px;
  height: 26px;
  stroke-width: 2px;
  color: white;
}

.ai-chat-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: -420px;
  width: 420px;
  max-width: 100%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
  z-index: 1200;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-light);
}
.ai-chat-drawer.active {
  right: 0;
}
html[dir="rtl"] .ai-chat-drawer {
  right: auto;
  left: -420px;
  border-left: none;
  border-right: 1px solid var(--border-light);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
html[dir="rtl"] .ai-chat-drawer.active {
  left: 0;
}

@media (max-width: 500px) {
  .ai-chat-drawer {
    width: 100%;
    right: -100%;
  }
  html[dir="rtl"] .ai-chat-drawer {
    left: -100%;
  }
}

.chat-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}
.chat-header h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.chat-header h3 svg {
  color: var(--accent);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: #f8fafc;
}
.chat-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  max-width: 85%;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  animation: viewFadeIn 0.2s ease-out;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
html[dir="rtl"] .chat-msg.user {
  border-bottom-right-radius: var(--radius-md);
  border-bottom-left-radius: 2px;
}
.chat-msg.ai {
  align-self: flex-start;
  background: var(--accent-light);
  color: var(--text-main);
  border: none;
  border-right: 3px solid var(--accent);
  border-radius: var(--radius-md);
}
html[dir="rtl"] .chat-msg.ai {
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: 2px;
}
.chat-msg p {
  color: inherit;
  font-size: inherit;
  margin-bottom: 0.5rem;
}
.chat-msg p:last-child {
  margin-bottom: 0;
}
.chat-msg ul, .chat-msg ol {
  margin-right: 1.25rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
html[dir="ltr"] .chat-msg ul, html[dir="ltr"] .chat-msg ol {
  margin-right: 0;
  margin-left: 1.25rem;
}
.chat-msg li {
  margin-bottom: 0.25rem;
}

.chat-quick-asks {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
  scrollbar-width: none;
}
.chat-quick-asks::-webkit-scrollbar {
  display: none;
}
.chat-quick-btn {
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-main);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.chat-quick-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.chat-input-area {
  padding: var(--space-4);
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
  display: flex;
  gap: var(--space-2);
}
.chat-input-area input {
  flex: 1;
}

/* Modal form style adjustment */
#modal-city .modal-body, #modal-activity .modal-body {
  max-height: 65vh;
}

/* Typing Indicator styles */
.typing-indicator-bubble {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem !important;
  background: var(--bg-app) !important;
  border: 1px solid var(--border-light) !important;
  max-width: 180px !important;
}
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* ================== UI COMPONENTS POLISH (PHASE 5) ================== */
#btn-chat-send {
  background: linear-gradient(135deg, var(--accent), #FF8E53) !important;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
  border: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#btn-chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6) !important;
}

.home-card, .list-card, .trip-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-card:hover, .list-card:hover, .trip-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -5px rgba(11, 19, 43, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
}

/* ================== PREMIUM SPLASH SCREEN ================== */
.travel-splash-screen {
    position: fixed;
    inset: 0;
    background-color: #0B132B;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOutSplash 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2.5s forwards;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.splash-logo {
    margin-bottom: 1rem;
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform: scale(0);
}

.splash-title {
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin: 0 0 0.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease-out 0.4s forwards;
}

.splash-tagline {
    color: #FF6B6B; /* Force bright coral always */
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInTagline 0.8s ease-out 0.8s forwards;
}

@keyframes popIn {
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideUpFade {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInTagline {
    to { opacity: 1; }
}

@keyframes fadeOutSplash {
    to { opacity: 0; visibility: hidden; z-index: -1; }
}


/* ================== CUSTOM SCROLLBAR ================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================== PREMIUM PDF & PRINT BRANDING ================== */
/* (consolidated into the single @media print block above) */

/* ================== OFFLINE MODE ================== */
.offline-badge { position: fixed; top: 15px; left: 50%; transform: translateX(-50%) translateY(-100px); background: rgba(228, 34, 58, 0.95); color: white; padding: 8px 20px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; z-index: 99999; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 25px rgba(228,34,58,0.3); pointer-events: none; font-family: 'Outfit', var(--font-arabic); direction: rtl; }
.offline-badge.show { transform: translateX(-50%) translateY(0); }

/* Readiness Grid Fix */
.readiness-details-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1.5rem;
}
#readiness-details-grid[style*="display: none"] {
    display: none !important;
}

.readiness-detail-item {
    gap: 0.5rem;
    overflow: hidden;
}

.readiness-detail-item span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.readiness-detail-item span:last-child {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Task 1 (Phase 15): Context-Aware Mobile Header Logo Text ===== */
/* Show text on Home view, hide it on all sub-pages on mobile */
@media (max-width: 768px) {
    body:not(.is-home-view) .hide-mobile-text {
        display: none !important;
    }
}

/* ===== (Phase 16): All print rules consolidated into the single @media print block at line 926 ===== */

/* ===== Task 2 (Phase 15): Dark Mode Alert Card Contrast ===== */
/* Override pastel light-mode alert backgrounds with dark, readable equivalents */
.dark-mode .ai-alert-item.severity-critical {
    background: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(220, 38, 38, 0.45) !important;
    color: #FCA5A5 !important;
}
.dark-mode .ai-alert-item.severity-high {
    background: rgba(217, 119, 6, 0.15) !important;
    border-color: rgba(217, 119, 6, 0.40) !important;
    color: #FCD34D !important;
}
.dark-mode .ai-alert-item.severity-medium {
    background: rgba(37, 99, 235, 0.15) !important;
    border-color: rgba(37, 99, 235, 0.40) !important;
    color: #93C5FD !important;
}
.dark-mode .ai-alert-item.severity-low {
    background: rgba(100, 116, 139, 0.15) !important;
    border-color: rgba(100, 116, 139, 0.35) !important;
    color: #CBD5E1 !important;
}

/* Alert titles and descriptions: force full opacity in dark mode */
.dark-mode .ai-alert-title {
    color: inherit !important;
    opacity: 1 !important;
}
.dark-mode .ai-alert-desc {
    opacity: 0.85 !important;
}

/* Alert action link (e.g. "Ignore" / "Add Now") in dark mode */
.dark-mode .ai-alert-action {
    color: inherit !important;
    opacity: 1 !important;
    text-decoration-color: currentColor !important;
}

/* Readiness status badges in dark mode */
.dark-mode .status-ok    { color: #6EE7B7 !important; }
.dark-mode .status-warn  { color: #FCD34D !important; }
.dark-mode .status-error { color: #FCA5A5 !important; }



/* ===== Phase 18: Typography System & Consistency ===== */
.view-header-container {
    text-align: center;
    margin-bottom: 2rem !important;
}

.unified-section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.unified-section-subtitle {
    font-size: clamp(1rem, 3vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Standardize Card & Container Metrics */
.card, .list-card, .form-container, .print-card, .readiness-card, .ai-alert-item {
    border-radius: 16px !important;
    padding: clamp(15px, 4vw, 24px) !important;
}

/* ===== Phase 19: Color Scheme Harmony ===== */
/* City Date Badge - Light Mode */
.city-date-badge {
    background-color: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
/* City Date Badge - Dark Mode */
.dark-mode .city-date-badge {
    background-color: rgba(255, 255, 255, 0.05);
    color: #E2E8F0;
    border-color: rgba(255, 255, 255, 0.1);
}


/* ===== Phase 21: Deep Branding Integration ===== */

/* Task 1: Brand the Day Selector */
.date-slide-btn.active,
.day-tab.active,
.day-selector-btn.active,
.day-slider .active,
.active-day-badge {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%) !important;
    color: #FFFFFF !important;
    border-color: transparent !important;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3) !important;
}

/* Task 2: Brand the Timeline */
.timeline-item {
    border-color: #FF7B5A !important;
}
.timeline-item::before,
.timeline-dot {
    background-color: #FF7B5A !important;
    border-color: #FF7B5A !important;
    box-shadow: 0 0 0 4px rgba(255, 123, 90, 0.2) !important;
}

/* Task 3: Brand the Floating AI Button */
.floating-ai-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
}

/* ===== Native Print Pagination & Colors ===== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    table, .list-card, .print-card, .activity-card, tr, td, th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    h1, h2, h3, h4 {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }
}
