/* ═══════════════════════════════════════════════
   hajj.css — Custom styles for Hajj AI Demo
   All color theming, layout overrides & components
   ═══════════════════════════════════════════════ */

/* ─── Color Variables ─── */
:root {
  --hajj-green:  #1a6b3c;
  --hajj-dark:   #0f3d22;
  --hajj-gold:   #c9a84c;
  --hajj-light:  #f0f7f4;
  --hajj-danger: #c0392b;
}

/* ─── Base Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 15px;
  min-height: 100vh;
  background-color: var(--hajj-light);
  margin: 0;
}

/* ══════════════════════════════
   SPLASH SCREEN (index.html)
══════════════════════════════ */
.splash-screen {
  min-height: 100vh;
  background: linear-gradient(160deg, #0f3d22, #1a6b3c);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.splash-icon {
  font-size: 72px;
  color: var(--hajj-gold);
  line-height: 1;
  margin-bottom: 24px;
  display: block;
}

.splash-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.splash-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.70);
  margin-bottom: 40px;
}

/* Gold CTA button */
.btn-gold {
  background-color: var(--hajj-gold);
  color: #1a1a1a;
  border: none;
  font-weight: 700;
  min-height: 52px;
  font-size: 16px;
  border-radius: 12px;
  padding: 0 32px;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-gold:hover,
.btn-gold:focus {
  opacity: 0.90;
  color: #1a1a1a;
  text-decoration: none;
}

/* NFC outline button */
.btn-nfc {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.80);
  min-height: 52px;
  font-size: 16px;
  border-radius: 12px;
  padding: 0 32px;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-nfc:hover,
.btn-nfc:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.splash-footer {
  margin-top: 48px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

/* ══════════════════════════════
   TOP NAVIGATION BAR (all pages except index)
══════════════════════════════ */
.hajj-navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  gap: 8px;
}

.hajj-navbar .nav-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--hajj-green);
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hajj-navbar .nav-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--hajj-green);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
  text-decoration: none;
}

.hajj-navbar .nav-btn:hover {
  background: var(--hajj-light);
  color: var(--hajj-green);
}

/* ══════════════════════════════
   LOCATION BAR (shared across service pages)
══════════════════════════════ */
.location-bar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 10px 16px;
}

.location-bar label {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
  display: block;
}

.location-bar select {
  border: 1.5px solid var(--hajj-green);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--hajj-green);
  font-weight: 600;
  font-size: 14px;
  background-color: #fff;
  width: 100%;
  cursor: pointer;
}

.location-bar select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.15);
}

/* ══════════════════════════════
   SERVICE CARDS (services.html)
══════════════════════════════ */
.service-card {
  background: #fff;
  border-radius: 14px;
  /* RTL: border on the right (visual start side) */
  border-right: 5px solid var(--hajj-green);
  padding: 20px 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.service-card:hover {
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.16);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.service-card .card-icon {
  font-size: 36px;
  color: var(--hajj-green);
  flex-shrink: 0;
  line-height: 1;
}

.service-card .card-body-text {
  flex: 1;
}

.service-card .card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.service-card .card-desc {
  font-size: 13px;
  color: #888;
}

.service-card .card-arrow {
  font-size: 20px;
  color: #ccc;
}

/* ══════════════════════════════
   PRIMARY ACTION BUTTONS
══════════════════════════════ */
.btn-hajj {
  background-color: var(--hajj-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-hajj:hover,
.btn-hajj:focus {
  opacity: 0.88;
  color: #fff;
  text-decoration: none;
}

.btn-hajj-outline {
  background: transparent;
  color: var(--hajj-green);
  border: 2px solid var(--hajj-green);
  border-radius: 10px;
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-hajj-outline:hover,
.btn-hajj-outline:focus {
  background: var(--hajj-light);
  color: var(--hajj-green);
  text-decoration: none;
}

/* ══════════════════════════════
   RESULT CARD (guidance.html)
══════════════════════════════ */
.result-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.result-card .result-label {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.result-card .result-value {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 18px;
}

/* ══════════════════════════════
   LOADING OVERLAY
══════════════════════════════ */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 61, 34, 0.60);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.active {
  display: flex;
}

.loading-overlay .spinner-border {
  width: 48px;
  height: 48px;
  color: var(--hajj-gold);
  border-width: 5px;
}

.loading-overlay .loading-text {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

/* ══════════════════════════════
   LANGUAGE PILLS (translation.html)
══════════════════════════════ */
.lang-pill {
  border: 2px solid var(--hajj-green);
  color: var(--hajj-green);
  background: #fff;
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.lang-pill.active,
.lang-pill:hover {
  background: var(--hajj-green);
  color: #fff;
}

/* ══════════════════════════════
   INSTRUCTION BOX (translation.html)
══════════════════════════════ */
.instruction-box {
  background: #fff;
  border-radius: 14px;
  padding: 22px 20px;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  min-height: 110px;
  transition: opacity 0.2s;
}

/* ══════════════════════════════
   CHAT INTERFACE (assistant.html)
══════════════════════════════ */
.page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--hajj-light);
}

/* RTL: user bubbles align to start (right), bot bubbles to end (left) */
.bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.55;
  word-wrap: break-word;
}

.bubble-user {
  background: var(--hajj-green);
  color: #fff;
  align-self: flex-start;
  border-bottom-right-radius: 4px;
}

.bubble-bot {
  background: #fff;
  color: #1a1a1a;
  align-self: flex-end;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* Animated typing indicator */
.typing-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #aaa;
  border-radius: 50%;
  margin: 0 2px;
  animation: dotBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-8px); }
}

/* Quick action buttons row */
.quick-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  background: #f4f4f4;
  border-top: 1px solid #eaeaea;
  scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar { display: none; }

.quick-btn {
  white-space: nowrap;
  background: #fff;
  border: 1.5px solid var(--hajj-green);
  color: var(--hajj-green);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.quick-btn:hover {
  background: var(--hajj-green);
  color: #fff;
}

/* Message input row */
.chat-input-area {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.chat-input-area input:focus {
  border-color: var(--hajj-green);
}

.send-btn {
  background: var(--hajj-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.send-btn:hover { opacity: 0.85; }

/* ══════════════════════════════
   ALERT PAGE (alert.html)
══════════════════════════════ */
.alert-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 0;
}

.alert-screen.danger { background: #fdecea; }
.alert-screen.safe   { background: #eaf7f0; }

.alert-icon {
  font-size: 72px;
  margin-bottom: 20px;
  line-height: 1;
}

.alert-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.alert-screen.danger .alert-title { color: var(--hajj-danger); }
.alert-screen.safe   .alert-title { color: var(--hajj-green); }

.alert-msg {
  font-size: 16px;
  color: #555;
  margin-bottom: 28px;
  max-width: 360px;
  line-height: 1.7;
}

/* ══════════════════════════════
   DASHBOARD (dashboard.html)
══════════════════════════════ */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--hajj-green);
  margin-top: 6px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.hajj-table thead th {
  background: var(--hajj-green);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border: none;
}

.hajj-table tbody td {
  vertical-align: middle;
  font-size: 14px;
  border-color: #f0f0f0;
}

.hajj-table tbody tr:hover {
  background: var(--hajj-light);
}

/* ══════════════════════════════
   PAGE CONTENT WRAPPER
══════════════════════════════ */
.page-content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ══════════════════════════════
   TOAST CONTAINER Z-INDEX FIX
══════════════════════════════ */
.toast-container { z-index: 99999 !important; }
