:root {
  --bg-primary: #0b0f19;
  --bg-surface: #111827;
  --bg-sheet: rgba(17, 24, 39, 0.94);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-400: #34d399;
  
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --amber-500: #f59e0b;
  --rose-500: #ef4444;
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-sub: #6b7280;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sheet: 0 -12px 36px rgba(0, 0, 0, 0.45);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow: hidden;
  position: relative;
}

/* ════════ 1. APP WRAPPER ════════ */
.takip-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ════════ 2. HEADER TOP BAR ════════ */
.top-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(180deg, rgba(11, 15, 25, 0.92) 0%, rgba(11, 15, 25, 0.6) 80%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 1000;
  pointer-events: none;
}

.header-left, .header-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.brand-icon {
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald-400);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-500);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--emerald-500);
  animation: radar-pulse 1.8s infinite;
}

@keyframes radar-pulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* ════════ 3. FULL MAP CANVAS ════════ */
#takipMap {
  flex: 1;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* MAP OVERLAY BUTTONS */
.map-controls {
  position: absolute;
  right: 16px;
  top: 80px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.map-control-btn:active {
  transform: scale(0.92);
  background: #1f2937;
}

/* ════════ 4. BOTTOM SHEET COCKPIT ════════ */
.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sheet);
  border-top: 1px solid var(--border-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-sheet);
  z-index: 1000;
  padding: 16px 20px 24px;
  max-width: 560px;
  margin: 0 auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin: 0 auto 12px;
}

/* ETA & STATUS ROW */
.status-eta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-headline {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-subline {
  font-size: 12px;
  color: var(--text-muted);
}

.eta-pill {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.25) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-align: right;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}

.eta-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--emerald-400);
}

.eta-val {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

/* 4 ADIMLI İLERLEME ÇUBUĞU */
.stepper-track {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 12px 6px 20px;
}

.stepper-track::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 25%;
}

.step-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid #4b5563;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.3s ease;
}

.step-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.step-node.completed .step-icon-wrap {
  background: var(--emerald-500);
  border-color: var(--emerald-400);
  color: #fff;
}

.step-node.active .step-icon-wrap {
  background: var(--blue-500);
  border-color: var(--blue-400);
  color: #fff;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.7);
  animation: active-glow 2s infinite;
}

.step-node.active .step-text {
  color: #fff;
  font-weight: 700;
}

@keyframes active-glow {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ════════ 5. TESLİMAT PIN KARTI (GÜVENLİ DEVİR) ════════ */
.delivery-pin-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.pin-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pin-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pin-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.pin-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* ════════ 6. DETAILS GRID (KURYE & RESTORAN) ════════ */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actor-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.actor-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.actor-info {
  flex: 1;
  overflow: hidden;
}

.actor-role {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-sub);
  font-weight: 700;
}

.actor-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-contact {
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ════════ 7. CUSTOM LEAFLET MARKERS ════════ */
.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
}

.courier-live-marker {
  position: relative;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 185, 129, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.4s ease;
}

.courier-pulse-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px solid var(--emerald-400);
  opacity: 0.8;
  animation: courier-wave 2s infinite ease-out;
}

@keyframes courier-wave {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.restaurant-pin-marker {
  width: 38px;
  height: 38px;
  background: #6366f1;
  border: 2px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.customer-pin-marker {
  width: 38px;
  height: 38px;
  background: #ef4444;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ════════ 8. FULLSCREEN OVERLAYS (HATA & BAŞARI) ════════ */
.overlay-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  z-index: 9999;
}

.overlay-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.overlay-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.overlay-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.overlay-btn {
  background: var(--emerald-600);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}
