/* styles.css — shared base styles for Sa-Baba
 *
 * Contains: CSS reset, CSS variables, typography, and common component styles.
 * Each page includes this and adds page-specific overrides inline or in a separate file.
 */

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

/* ── CSS Variables (Design Tokens) ──────────────────────── */
:root {
  --blue:       #1F4E79;
  --mid-blue:   #2E75B6;
  --light-blue: #D6E4F0;
  --bg:         #F0F4F8;
  --white:      #FFFFFF;
  --text:       #1A1A1A;
  --muted:      #6B7280;
  --border:     #D1D5DB;
  --success:    #16A34A;
  --warn:       #D97706;
  --error:      #DC2626;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.10);
}

/* ── Typography ─────────────────────────────────────────── */
html {
  font-family: 'Heebo', sans-serif;
  color: var(--text);
  overflow-x: clip;          /* prevent horizontal scroll without breaking sticky */
}

/* ── Background (all non-admin pages via styles.css) ────── */
body {
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  padding: 0 0 60px;
  background: url('img/bg-l.webp') center/cover no-repeat fixed;
}
@media (max-width: 767px) {
  body {
    background-image: url('img/bg-p.webp');
    background-attachment: scroll;
  }
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(240, 244, 248, 0.45);
  z-index: 0;
}
/* keep class available for backward compat */
.sababa-bg { /* no-op — body rule handles it */ }

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--blue);
  color: white;
  padding: 20px 24px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header h1 { font-size: 1.4rem; font-weight: 700; }
.header p  { font-size: 0.85rem; opacity: 0.85; margin-top: 2px; }

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--light-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Form Fields ────────────────────────────────────────── */
.field { margin-bottom: 18px; }

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
label .req, .req { color: var(--error); margin-right: 2px; }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: white;
  direction: rtl;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mid-blue);
  box-shadow: 0 0 0 3px rgba(46,117,182,0.15);
}

.field-hint  { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.field-error { font-size: 0.8rem; color: var(--error); margin-top: 4px; display: none; }
.field-error.show { display: block; }

/* ── Check options ──────────────────────────────────────── */
.check-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.check-option:has(input:checked) {
  border-color: var(--mid-blue);
  background: #EFF6FF;
}
.check-option input { width: 18px; height: 18px; cursor: pointer; }
.check-option .opt-label { font-size: 0.95rem; font-weight: 500; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary   { background: var(--mid-blue); color: white; }
.btn-primary:hover { background: #1a5c8f; }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: var(--error); color: white; }
.btn-danger:hover  { background: #b91c1c; }
.btn-ghost     { background: transparent; color: var(--mid-blue); border: 1.5px solid var(--mid-blue); }
.btn-ghost:hover   { background: var(--light-blue); }
.btn-full      { width: 100%; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Map container ──────────────────────────────────────── */
.map-container {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  margin-top: 10px;
}
.map-confirm-bar {
  background: #F8FAFC;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.map-address-label { font-size: 0.85rem; color: var(--text); flex: 1; }

/* ── Route picker summary card ─────────────────────────── */
.rp-summary {
  margin-top: 12px; padding: 12px 16px;
  background: #F0FDF4; border: 2px solid var(--success, #16A34A);
  border-radius: 8px; font-size: 0.9rem;
}
.rp-summary-row {
  display: flex; justify-content: space-between; padding: 4px 0;
}
.rp-summary-hint {
  margin-top: 8px; font-size: 0.82rem; color: var(--muted, #6B7280);
  line-height: 1.5;
}

/* ── Home link ──────────────────────────────────────────── */
.home-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--mid-blue);
  font-weight: 600;
  text-decoration: none;
}
.home-link:hover { text-decoration: underline; }

/* ── LTR support ────────────────────────────────────────── */
html[dir="ltr"] body { direction: ltr; text-align: left; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 18px; }
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes popIn {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.4); }
}

/* ── Marketplace Colors (Design Tokens) ──────────────────── */
:root {
  --green:       #82D026;  /* Growth Green — community/free */
  --yellow:      #FFD200;  /* Reliable Yellow — professional */
  --sababa-blue: #0093D1;  /* Sa-Baba Blue — shuttle/bus */
}

/* ── Ride-type check options (colored borders when selected) ── */
.check-option:has(input[value="community"]:checked)    { border-color: var(--green);       background: rgba(130,208,38,0.08); }
.check-option:has(input[value="professional"]:checked)  { border-color: var(--yellow);      background: rgba(255,210,0,0.08); }
.check-option:has(input[value="shuttle"]:checked)       { border-color: var(--sababa-blue); background: rgba(0,147,209,0.08); }

/* ── Button loading spinner ──────────────────────────────── */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin .6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ── Green aura glow for community items ─────────────────── */
@keyframes greenGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(130,208,38,0.3); }
  50%      { box-shadow: 0 0 18px rgba(130,208,38,0.5); }
}
