/* ============================================================
   driver.css — تصميم تطبيق السائق
   Modern Dashboard Style — Dark Mode with accent colors
   ============================================================ */

/* ===== Google Font ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-card:       #1c2333;
  --bg-card-hover: #222d42;
  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --accent-glow:   rgba(59,130,246,0.3);
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #06b6d4;
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --border:        rgba(255,255,255,0.08);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'Cairo', sans-serif;
  --topbar-h: 64px;
  --transition: 0.25s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; }

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Login Page ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 30%, rgba(59,130,246,0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 70%, rgba(99,102,241,0.15) 0%, transparent 55%);
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: blobFloat 8s ease-in-out infinite alternate;
}
.blob1 { width: 420px; height: 420px; background: rgba(59,130,246,0.15); top: -80px; left: -80px; }
.blob2 { width: 300px; height: 300px; background: rgba(99,102,241,0.12); bottom: -60px; right: -60px; animation-delay: -4s; }

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(28, 35, 51, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 40px;
  width: min(420px, 92vw);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.logo-icon { font-size: 52px; display: block; margin-bottom: 12px; filter: drop-shadow(0 0 20px var(--accent)); }
.login-logo h1 { font-size: 1.7rem; font-weight: 800; background: linear-gradient(135deg, #fff 30%, var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-logo p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; }
.form-group input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.form-group input::placeholder { color: var(--text-secondary); }

.input-wrapper { position: relative; }
.input-wrapper input { padding-left: 44px; }
.eye-btn {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 1.1rem;
  line-height: 1; padding: 4px;
}

.error-msg { color: var(--danger); font-size: 0.85rem; text-align: center; min-height: 20px; margin-bottom: 8px; animation: shake 0.3s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px var(--accent-glow); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  padding: 12px 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-secondary:hover { background: var(--bg-card-hover); }

.loader {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Dashboard Layout ===== */
.dashboard-page { padding-top: var(--topbar-h); }

/* Topbar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-light);
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.driver-status-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  color: var(--success);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s ease infinite;
}
.pulse-dot.green { background: var(--success); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
  border: 2px solid var(--accent-glow);
}
.user-name { font-weight: 700; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-secondary); }

.btn-logout {
  padding: 8px 16px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--danger);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.22); }

/* Main Content */
.main-content { padding: 28px 24px; max-width: 1200px; margin: 0 auto; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { font-size: 2rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent-light); }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* Alert Banner */
.alert-banner {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--warning);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* Section */
.section-block { margin-bottom: 36px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 1.1rem; font-weight: 700; }

.realtime-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
  color: var(--success);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Orders Grid */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: cardIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
@keyframes cardIn { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }
.order-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.order-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); border-color: var(--accent); }

.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.order-id { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; }

/* Status Badges */
.badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.73rem;
  font-weight: 700;
  display: inline-block;
}
.badge-new      { background: rgba(59,130,246,0.15);  color: #60a5fa;  border: 1px solid rgba(59,130,246,0.3);  }
.badge-reserved { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-pickedup { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-delivered{ background: rgba(34,197,94,0.15);  color: #4ade80;  border: 1px solid rgba(34,197,94,0.3);  }
.badge-cancelled{ background: rgba(239,68,68,0.12);  color: #f87171;  border: 1px solid rgba(239,68,68,0.25); }

.order-info { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.order-info-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.order-info-row .ico { font-size: 1rem; opacity: 0.8; }
.order-info-row .lbl { color: var(--text-secondary); min-width: 60px; }
.order-info-row .val { font-weight: 700; color: var(--text-primary); }
.order-info-row .val.price { color: var(--success); font-size: 1rem; }

.order-time { font-size: 0.75rem; color: var(--text-secondary); margin-top: -6px; }

.order-actions { display: flex; flex-direction: column; gap: 8px; }

.btn-accept {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #166534, #16a34a);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(22,163,74,0.3);
}
.btn-accept:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,163,74,0.4); }

.btn-pickup {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #0c4a6e, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition);
  box-shadow: 0 4px 16px rgba(14,165,233,0.3);
}
.btn-pickup:hover { transform: translateY(-1px); }

.btn-deliver {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #14532d, #22c55e);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition);
  box-shadow: 0 4px 16px rgba(34,197,94,0.35);
}
.btn-deliver:hover { transform: translateY(-1px); }

.order-card.removing { animation: cardOut 0.4s ease forwards; }
@keyframes cardOut { to { opacity:0; transform:scale(0.85); height:0; padding:0; margin:0; border-width:0; } }

/* Empty State */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.empty-state::before { content: '📭'; font-size: 2.5rem; display: block; margin-bottom: 12px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px;
  width: min(400px, 90vw);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn { from { transform:scale(0.85); opacity:0; } to { transform:scale(1); opacity:1; } }

.modal-icon { font-size: 3.5rem; margin-bottom: 16px; }
.modal h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.modal p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; line-height: 1.6; }

.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-actions .btn-primary { width: auto; padding: 12px 28px; }

/* Responsive */
@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .topbar-brand span:last-child { display: none; }
  .driver-status-tag { display: none; }
  .user-name, .user-role { display: none; }
  .main-content { padding: 16px 12px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
