/* =============================================================================
   driver.css — واجهة السائق (تصميم يبدأ من الجوال)
   ============================================================================= */

.driver-shell { max-width: 560px; margin-inline: auto; padding-bottom: 120px; }

/* شريط علوي مبسّط للسائق */
.driver-top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.driver-top-inner {
  display: flex; align-items: center; gap: var(--sp-3);
  height: 60px; padding-inline: var(--sp-4); max-width: 560px; margin-inline: auto;
}
.driver-pick {
  flex: 1; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text);
  font-weight: 700; font-size: .92rem; appearance: none; max-width: 240px;
}

.driver-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }

/* بطاقة الحالة الرئيسية (البطل) */
.hero-status {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: var(--sp-6);
  color: #fff; box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--st-idle), color-mix(in srgb, var(--st-idle) 70%, #000));
  transition: background var(--dur-slow) var(--ease);
}
.hero-status[data-status="loading"]   { background: linear-gradient(135deg, #F59E0B, #B45309); }
.hero-status[data-status="enroute"]   { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.hero-status[data-status="arrived"]   { background: linear-gradient(135deg, #22C55E, #15803D); }
.hero-status[data-status="returning"] { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.hero-status[data-status="idle"]      { background: linear-gradient(135deg, #64748B, #334155); }

.hero-status::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: -30%; width: 55%;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.10) 0 16px, transparent 16px 32px);
  pointer-events: none;
}
.hero-truck { display: flex; align-items: center; gap: 10px; font-weight: 700; opacity: .95; }
.hero-truck svg { width: 22px; height: 22px; }
.hero-now {
  font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; line-height: 1.1;
  margin-top: var(--sp-3); display: flex; align-items: center; gap: 14px;
}
.hero-now .beat { width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: heroBeat 1.8s var(--ease) infinite; }
.hero-status[data-status="idle"] .beat { animation: none; opacity: .6; }
@keyframes heroBeat { 0%{box-shadow:0 0 0 0 rgba(255,255,255,.6);} 70%{box-shadow:0 0 0 12px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }
.hero-meta { display: flex; gap: var(--sp-6); margin-top: var(--sp-4); }
.hero-meta div span { display: block; opacity: .8; font-size: .78rem; }
.hero-meta div strong { font-family: var(--font-display); font-size: 1.15rem; }

/* مبدّل الحالة (أزرار كبيرة للمس) */
.status-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.status-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: var(--sp-4); border-radius: var(--r-md);
  background: var(--surface); border: 2px solid var(--border);
  font-weight: 700; color: var(--text-2); transition: all var(--dur-fast) var(--ease);
}
.status-btn .ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); transition: all var(--dur-fast) var(--ease); }
.status-btn .ico svg { width: 22px; height: 22px; }
.status-btn:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.status-btn[data-active="true"] { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.status-btn[data-active="true"] .ico { background: var(--c); color: #fff; }
.status-btn[data-key="loading"]   { --c: var(--st-loading); }
.status-btn[data-key="enroute"]   { --c: var(--st-enroute); }
.status-btn[data-key="arrived"]   { --c: var(--st-arrived); }
.status-btn[data-key="returning"] { --c: var(--st-returning); }

/* عنوان قسم صغير */
.sec-title { display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.sec-title .hint { font-family: var(--font-body); font-weight: 500; font-size: .8rem; color: var(--text-muted); }

/* بطاقة الرحلة */
.trip-card .trip-route { display: flex; align-items: center; gap: 10px; font-weight: 800;
  font-family: var(--font-display); font-size: 1.2rem; }
.trip-card .trip-route svg { width: 20px; height: 20px; color: var(--brand); }
.trip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-4); }
.trip-grid .box { background: var(--surface-2); border-radius: var(--r-sm); padding: var(--sp-3); }
.trip-grid .box span { display: block; color: var(--text-muted); font-size: .76rem; margin-bottom: 2px; }
.trip-grid .box strong { font-family: var(--font-display); font-size: 1rem; }

/* عدّاد الكيلومترات */
.km-card { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.km-big { font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 1; }
.km-big small { font-size: .95rem; font-weight: 700; color: var(--text-muted); }

/* مقاييس الصيانة */
.maint-list { display: flex; flex-direction: column; gap: var(--sp-4); }

/* شريط إجراءات ثابت أسفل الشاشة */
.action-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  display: flex; gap: var(--sp-3); max-width: 560px; margin-inline: auto;
}
.action-bar .btn { flex: 1; }

/* حالة عدم وجود رحلة */
.no-trip { text-align: center; color: var(--text-muted); padding: var(--sp-8) var(--sp-4); }
.no-trip svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 10px; }
