@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================
   BONDU 24 - NATIVE APP DESIGN SYSTEM (OFFER MODEL)
   ========================================= */
:root {
  /* Exact Colors from logo.jpeg */
  --color-emergency: #a12d3d; /* Premium Crimson */
  --color-emergency-hover: #8a2431;
  --color-navy: #06194b; /* Deep Premium Navy */
  --color-navy-light: #122863;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  
  /* Surfaces */
  --color-bg-app: #F3F4F6;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F8FAFC;
  
  /* Driver App (Dark Mode) Variables */
  --driver-bg: #030d2a;
  --driver-surface: #06194b;
  --driver-text: #FFFFFF;
  --driver-text-muted: #94a3b8;
  --driver-border: rgba(255, 255, 255, 0.1);
  
  /* Text */
  --text-primary: #06194b;
  --text-secondary: #64748B;
  --text-inverse: #FFFFFF;
  
  /* Borders */
  --border-light: rgba(6, 25, 75, 0.08);
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Elevation (Shadows) */
  --shadow-float: 0 12px 32px rgba(6, 25, 75, 0.08), 0 4px 8px rgba(6, 25, 75, 0.04);
  --shadow-subtle: 0 4px 12px rgba(6, 25, 75, 0.05);
  --shadow-glow-red: 0 8px 24px rgba(161, 45, 61, 0.3);
  --shadow-sheet: 0 -10px 30px rgba(6, 25, 75, 0.1);
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --bottom-nav-height: 80px;
}

/* =========================================
   APP SHELL FOUNDATION
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Strictly enforce no-bounce, full viewport app shell */
html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Mobile viewport bug fix */
  overflow: hidden; /* NO SCROLLING ON BODY */
  background-color: var(--color-bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; /* Prevent pull-to-refresh */
}

/* Scrollable container for main content */
.app-content-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
  padding-bottom: 120px; /* Space for bottom nav / floating actions */
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px; /* Keep it mobile-width on desktop for true app feel */
  margin: 0 auto;
  background: var(--color-bg-app);
  position: relative;
  box-shadow: var(--shadow-float); /* Makes it look like a phone on desktop */
}

/* Branding */
.brand-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* =========================================
   COMMON APP COMPONENTS
   ========================================= */
.btn-app {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-app:active { transform: scale(0.96); }

.btn-primary { background: var(--color-emergency); color: var(--text-inverse); box-shadow: var(--shadow-glow-red); }
.btn-primary:hover { background: var(--color-emergency-hover); }

.btn-navy { background: var(--color-navy); color: var(--text-inverse); }

/* Slide-up Bottom Sheet */
.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px;
  box-shadow: var(--shadow-sheet);
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-sheet.is-open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 4px;
  margin: 0 auto 20px;
}

/* Modal Overlay */
.modal-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(6, 25, 75, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.is-active { opacity: 1; pointer-events: auto; }

/* Header & Nav */
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--color-surface); z-index: 40; border-bottom: 1px solid var(--border-light); }
.icon-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); background: var(--color-bg-app); border: none; color: var(--color-navy); cursor: pointer; transition: transform 0.2s; }
.icon-btn:active { transform: scale(0.92); }

.bottom-nav { position: absolute; bottom: 0; left: 0; width: 100%; height: var(--bottom-nav-height); background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); border-top: 1px solid var(--border-light); display: flex; justify-content: space-around; align-items: center; z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-secondary); text-decoration: none; font-size: 11px; font-weight: 500; transition: color 0.2s; }
.nav-item.active { color: var(--color-emergency); }

/* Components */
.app-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: 20px; margin: 16px 20px; box-shadow: var(--shadow-subtle); border: 1px solid var(--border-light); }

.input-group { display: flex; align-items: center; background: var(--color-bg-app); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 12px; border: 1px solid transparent; transition: border 0.2s; }
.input-group:focus-within { border-color: var(--color-navy); background: var(--color-surface); }
.input-group i { color: var(--text-secondary); margin-right: 12px; }
.input-group input { border: none; background: transparent; font-size: 15px; font-weight: 500; color: var(--color-navy); width: 100%; outline: none; }

/* Offer Card (For Bidding System) */
.offer-card {
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
  transform: translateY(20px);
  opacity: 0;
  animation: slideUpFade 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideUpFade {
  to { transform: translateY(0); opacity: 1; }
}

.offer-header { display: flex; justify-content: space-between; align-items: center; }
.offer-driver { display: flex; align-items: center; gap: 12px; }
.offer-driver-img { width: 40px; height: 40px; border-radius: 50%; background: var(--color-bg-app); display: flex; align-items: center; justify-content: center; color: var(--color-navy); }
.offer-fare { font-size: 20px; font-weight: 700; color: var(--color-navy); }

/* =========================================
   DRIVER APP (dark mode overrides)
   ========================================= */
.driver-mode { background-color: var(--driver-bg); color: var(--driver-text); }
.driver-mode .app-container { background: var(--driver-bg); }
.driver-mode .app-header { background: var(--driver-surface); border-bottom: 1px solid var(--driver-border); }
.driver-mode .icon-btn { background: rgba(255,255,255,0.1); color: white; }
.driver-mode .app-card { background: var(--driver-surface); border-color: var(--driver-border); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.driver-mode .bottom-nav { background: var(--driver-surface); border-color: var(--driver-border); }
.driver-mode .input-group { background: var(--driver-bg); }
.driver-mode .input-group input { color: white; }

/* Massive Go Online Toggle */
.online-toggle-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; }
.toggle-circle { width: 160px; height: 160px; border-radius: 50%; background: var(--driver-surface); border: 4px solid var(--driver-border); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--driver-text-muted); box-shadow: 0 0 30px rgba(0,0,0,0.5); cursor: pointer; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.toggle-circle.is-online { background: var(--color-success); border-color: var(--color-success); color: white; box-shadow: 0 0 40px rgba(16, 185, 129, 0.4); }

/* Driver Modal */
.request-modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); width: 90%; max-width: 400px; background: var(--color-surface); color: var(--color-navy); border-radius: var(--radius-lg); padding: 24px; z-index: 105; opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.request-modal.is-active { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
