/* ==============================================================================
   SASTAMART QUICK COMMERCE - DELIVERY PARTNER (RIDER) STYLESHEET
   File: rider/css/rider.css
   Aesthetic: Mobile-First, Outdoor High-Contrast, Large Touch Targets
   ============================================================================== */

:root {
  --primary: #0c8340;
  --primary-hover: #096a33;
  --primary-light: #ecfdf5;
  --primary-border: #a7f3d0;

  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-border: #334155;

  --canvas-bg: #f1f5f9;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #64748b;

  --accent-amber: #d97706;
  --accent-amber-bg: #fef3c7;
  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--canvas-bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 30px;
}

/* --------------------------------------------------------------------------
   Rider Topbar Header
--------------------------------------------------------------------------- */
.rider-header {
  background: var(--dark-bg);
  color: #fff;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid var(--dark-border);
}

.rider-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rider-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rider-brand-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.rider-profile-meta h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.rider-profile-meta p {
  font-size: 0.72rem;
  color: #94a3b8;
}

.rider-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Duty Switch Button */
.btn-duty-toggle {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-duty-toggle.on-duty {
  background: #065f46;
  border-color: #10b981;
  color: #34d399;
}

.gps-beacon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
  animation: beaconPulse 1.5s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.btn-rider-logout {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #475569;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Container & Daily Metrics
--------------------------------------------------------------------------- */
.rider-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rider-metric-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.rider-metric-box span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.rider-metric-box strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.rider-metric-box.cash strong {
  color: var(--accent-amber);
}

/* --------------------------------------------------------------------------
   Active Delivery Card
--------------------------------------------------------------------------- */
.delivery-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  border-left: 6px solid var(--primary);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-order-id {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.card-status-pill {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Customer Block */
.customer-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid var(--border-color);
}

.cust-info strong {
  font-size: 0.95rem;
  color: var(--text-main);
  display: block;
}

.cust-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-call-cust {
  background: #10b981;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Address Block */
.address-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.address-icon {
  font-size: 1.2rem;
  margin-top: 2px;
}

.address-details strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}

.address-details span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Items Snapshot */
.items-snapshot {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8rem;
  border: 1px dashed var(--border-color);
}

.items-snapshot strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 2px;
}

/* Payment Badge */
.payment-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
}

.payment-badge.cod {
  background: var(--accent-amber-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

.payment-badge.prepaid {
  background: var(--accent-blue-bg);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Action Buttons */
.card-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.btn-navigate-map {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(12, 131, 64, 0.2);
  transition: background 0.15s ease;
}

.btn-navigate-map:hover {
  background: var(--primary-hover);
}

.btn-complete-delivery {
  background: var(--dark-bg);
  color: #ffffff;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.btn-complete-delivery:hover {
  background: #334155;
}

/* --------------------------------------------------------------------------
   OTP Verification Modal
--------------------------------------------------------------------------- */
.otp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.otp-modal-overlay.active {
  display: flex;
}

.otp-dialog {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.otp-dialog h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.otp-input-field {
  width: 100%;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--primary);
  background: #f8fafc;
  transition: border-color 0.15s ease;
}

.otp-input-field:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(12, 131, 64, 0.15);
}

/* --------------------------------------------------------------------------
   Toast Notifications
--------------------------------------------------------------------------- */
.rider-toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.rider-toast {
  background: var(--dark-bg);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.25s ease;
}

.rider-toast.success { border-left: 4px solid var(--primary); }
.rider-toast.error   { border-left: 4px solid #ef4444; }

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