/* =============================================
   ZWET RIDE — CAPTAIN APP STYLES
   Premium driver/captain UI
   ============================================= */

/* App Shell */
#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}
@media (min-width: 1024px) {
  body { background: var(--bg-secondary); }
  #app { box-shadow: var(--shadow-xl); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

.screen-view { display: none; min-height: 100vh; }
.screen-view.active-view { display: block; }

/* Splash */
.splash-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #064E3B 0%, #0A0A10 100%);
}
.splash-screen .logo-icon { font-size: 4rem; color: #10B981; margin-bottom: 16px; animation: bounce 2s infinite; }
.splash-screen h1 { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 900; color: #FFF; }
.splash-screen h1 span { color: #10B981; }
.splash-screen p { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-top: 8px; }
.splash-progress { width: 120px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 10px; margin-top: 40px; overflow: hidden; }
.splash-progress .bar { height: 100%; background: #10B981; border-radius: 10px; animation: progressBar 2s ease-in-out forwards; }

/* Auth */
.auth-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; background: var(--bg);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-header { text-align: center; margin-bottom: 36px; }
.auth-logo { font-size: 2.5rem; color: #10B981; margin-bottom: 12px; }
.auth-header h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.auth-header p { color: var(--text-muted); font-size: 0.9rem; }

.input-group {
  display: flex; align-items: center; background: var(--bg-secondary);
  border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 0 16px; margin-bottom: 14px;
  transition: border-color 0.3s;
}
.input-group:focus-within { border-color: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.input-group i { color: var(--text-muted); font-size: 1rem; width: 20px; }
.input-group input { flex: 1; padding: 16px 12px; background: transparent; color: var(--text); font-size: 1rem; border: none; outline: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: var(--radius-lg); font-weight: 700; font-size: 1rem; transition: all 0.3s; cursor: pointer; border: none; }
.btn:active { transform: scale(0.96); }
.btn-captain { background: #10B981; color: white; box-shadow: 0 4px 20px rgba(16,185,129,0.3); }
.btn-captain:hover { background: #059669; }
.btn-full { width: 100%; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: #10B981; color: #10B981; }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 10px; }
.btn-danger { background: #EF4444; color: white; }

/* Dashboard Header */
.dash-header {
  background: linear-gradient(135deg, #064E3B, #10B981);
  padding: 24px 20px 30px;
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  color: white;
}
.dash-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.dash-header h2 { font-size: 1.4rem; font-weight: 800; }
.dash-header .zone { font-size: 0.8rem; opacity: 0.8; margin-top: 2px; }

/* Online Toggle */
.online-toggle {
  display: flex; align-items: center; gap: 10px;
}
.toggle-switch {
  width: 56px; height: 28px; background: rgba(255,255,255,0.2);
  border-radius: 50px; position: relative; cursor: pointer; transition: background 0.3s;
}
.toggle-switch.active { background: #34D399; }
.toggle-switch .knob {
  width: 22px; height: 22px; background: white; border-radius: 50%;
  position: absolute; top: 3px; left: 3px; transition: left 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch.active .knob { left: 31px; }
.online-label { font-size: 0.8rem; font-weight: 700; }

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px;
}
.stat-card {
  background: rgba(255,255,255,0.12); padding: 16px; border-radius: var(--radius-xl); text-align: center;
  backdrop-filter: blur(10px);
}
.stat-card .stat-label { font-size: 0.75rem; opacity: 0.8; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 900; }
.stat-card .stat-sub { font-size: 0.7rem; opacity: 0.7; margin-top: 4px; }

/* Dashboard Content */
.dash-content {
  padding: 20px;
  padding-bottom: calc(var(--bottom-nav-height) + 30px);
}

/* Incoming Ride Request */
.ride-request-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85); z-index: 1000;
  display: none; align-items: center; justify-content: center;
  max-width: 480px; margin: 0 auto; padding: 20px;
}
.ride-request-overlay.active { display: flex; }
.ride-request-card {
  width: 100%; background: var(--bg); border-radius: var(--radius-2xl);
  overflow: hidden; animation: scaleBounce 0.5s ease-out;
}
.rr-header {
  background: #10B981; color: white; padding: 20px; text-align: center;
}
.rr-timer {
  width: 60px; height: 60px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; margin: 0 auto 12px;
}
.rr-body { padding: 20px; }
.rr-route {
  display: flex; flex-direction: column; gap: 0; padding: 16px;
  background: var(--bg-secondary); border-radius: var(--radius-lg); margin-bottom: 16px;
  position: relative;
}
.rr-route::before {
  content: ''; position: absolute; left: 32px; top: 40px; bottom: 40px;
  width: 2px; background: var(--border);
}
.rr-point { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.rr-point .point-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; z-index: 2; }
.rr-point .point-name { font-weight: 600; font-size: 0.9rem; }
.rr-info { display: flex; justify-content: space-around; text-align: center; margin-bottom: 20px; }
.rr-info-item .rr-val { font-size: 1.3rem; font-weight: 800; }
.rr-info-item .rr-label { font-size: 0.75rem; color: var(--text-muted); }
.rr-actions { display: flex; gap: 12px; }
.rr-actions .btn { flex: 1; padding: 16px; font-size: 1rem; }

/* Active Ride */
.active-ride-card {
  background: var(--bg-card); border: 2px solid #10B981;
  border-radius: var(--radius-2xl); overflow: hidden; margin-bottom: 20px;
}
.ar-header {
  background: rgba(16,185,129,0.1); padding: 16px; display: flex;
  justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border);
}
.ar-status-badge {
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700; background: #10B981; color: white;
}
.ar-body { padding: 16px; }
.ar-customer { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ar-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(16,185,129,0.1);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #10B981;
}
.ar-name { font-weight: 700; font-size: 1.05rem; }
.ar-phone { font-size: 0.8rem; color: var(--text-muted); }
.ar-steps { display: flex; flex-direction: column; gap: 0; }
.ar-step {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--radius-lg); cursor: pointer; transition: all 0.3s;
}
.ar-step:hover { background: var(--bg-secondary); }
.ar-step.active { background: rgba(16,185,129,0.08); }
.ar-step .step-num {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0; transition: all 0.3s;
}
.ar-step.completed .step-num { background: #10B981; border-color: #10B981; color: white; }
.ar-step.active .step-num { border-color: #10B981; color: #10B981; }
.ar-step .step-text { font-weight: 600; font-size: 0.9rem; }

/* Earnings */
.earnings-card {
  background: linear-gradient(135deg, #064E3B, #10B981);
  border-radius: var(--radius-2xl); padding: 24px; color: white; margin-bottom: 24px;
}
.earnings-amount { font-size: 2.5rem; font-weight: 900; margin: 8px 0; }
.earnings-label { font-size: 0.85rem; opacity: 0.8; }

.earnings-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 120px;
  padding: 16px 0; margin-bottom: 20px;
}
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar {
  width: 100%; border-radius: 6px 6px 0 0; background: rgba(16,185,129,0.2);
  position: relative; min-height: 4px; transition: height 1s ease;
}
.chart-bar .fill { position: absolute; bottom: 0; width: 100%; background: #10B981; border-radius: 6px 6px 0 0; transition: height 1s ease; }
.chart-day { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* Incentives */
.incentive-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); margin-bottom: 10px; transition: all 0.3s;
}
.incentive-card:hover { box-shadow: var(--shadow-md); }
.incentive-icon {
  width: 44px; height: 44px; border-radius: var(--radius-lg);
  background: rgba(16,185,129,0.1); color: #10B981;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.incentive-info { flex: 1; }
.incentive-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.incentive-progress { height: 6px; background: var(--bg-tertiary); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.incentive-progress .fill { height: 100%; background: #10B981; border-radius: 10px; transition: width 1s ease; }
.incentive-bonus { font-weight: 800; color: #10B981; font-size: 0.95rem; white-space: nowrap; }

/* Leaderboard */
.leader-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--radius-lg); margin-bottom: 4px; transition: background 0.2s;
}
.leader-row:hover { background: var(--bg-secondary); }
.leader-row.me { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.leader-rank {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; flex-shrink: 0;
}
.rank-1 { background: #FFD700; color: #1A1A2E; }
.rank-2 { background: #C0C0C0; color: #1A1A2E; }
.rank-3 { background: #CD7F32; color: white; }
.rank-other { background: var(--bg-tertiary); color: var(--text-muted); }
.leader-name { flex: 1; font-weight: 600; }
.leader-earnings { font-weight: 800; color: #10B981; }

/* Ride History Card */
.history-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 16px; margin-bottom: 12px;
}
.hc-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
.hc-id { font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; }
.hc-status { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full); }
.hc-completed { background: rgba(16,185,129,0.1); color: #10B981; }
.hc-cancelled { background: rgba(239,68,68,0.1); color: #EF4444; }
.hc-route { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.hc-bottom { display: flex; justify-content: space-between; align-items: center; }
.hc-fare { font-weight: 800; font-size: 1.1rem; }
.hc-date { font-size: 0.75rem; color: var(--text-muted); }

/* Profile Section */
.captain-profile-header {
  text-align: center; padding: 30px 20px;
  background: linear-gradient(135deg, #064E3B, #10B981);
  border-radius: var(--radius-2xl); color: white; margin-bottom: 24px;
}
.captain-avatar-large {
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 3px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; margin: 0 auto 14px;
}
.captain-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.captain-badge {
  padding: 4px 12px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15); font-size: 0.7rem; font-weight: 600;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: 70px;
  background: var(--bg-glass-strong); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 16px; color: var(--text-muted); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s; border-radius: var(--radius-lg);
}
.nav-item i { font-size: 1.2rem; }
.nav-item.active { color: #10B981; }

/* Screen Header */
.screen-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-glass-strong); backdrop-filter: blur(20px);
  padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border-light);
}
.screen-header h2 { font-size: 1.2rem; font-weight: 800; flex: 1; }
.back-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s; color: var(--text);
}
.back-btn:hover { background: var(--bg-secondary); }

.screen-body {
  padding: 20px; padding-bottom: calc(70px + 30px);
}

/* Section Title */
.section-title {
  font-size: 1rem; font-weight: 800; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-title i { color: #10B981; }

/* Empty State */
.empty-state {
  text-align: center; padding: 60px 30px;
}
.empty-state i { font-size: 3rem; color: var(--border); margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* PIN Verify Input */
.pin-verify {
  display: flex; gap: 10px; justify-content: center; margin: 20px 0;
}
.pin-box {
  width: 50px; height: 50px; text-align: center; font-size: 1.3rem; font-weight: 800;
  background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text); outline: none;
}
.pin-box:focus { border-color: #10B981; }

/* Note: Shared button classes (.btn-site, .btn-site-primary, .btn-site-outline) are defined in shared/site.css */

@media (max-width: 380px) {
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-value { font-size: 1.3rem; }
}
