/* =====================================================
   OJOL APP - Main Stylesheet
   Mobile-First Design (Max 420px)
   ===================================================== */

:root {
  /* Primary Colors */
  --primary: #00AA13;
  --primary-dark: #008C10;
  --primary-light: #E8F5E9;

  /* Accent Colors */
  --accent: #FF5722;
  --accent-light: #FFF3E0;

  /* Dark Theme */
  --dark: #1A1A2E;
  --dark-lighter: #2D2D44;

  /* Grays */
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  /* System */
  --white: #FFFFFF;
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #F44336;
  --info: #2196F3;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Safe Areas */
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

/* Reset & Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Mobile Container */
.app-container {
  max-width: 420px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   SCREENS
   ===================================================== */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

#homeScreen {
  padding-bottom: 100px;
}

/* =====================================================
   HOME SCREEN
   ===================================================== */

/* Header */
.home-header {
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark-lighter) 100%);
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.home-header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.home-header::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -30px;
  width: 120px;
  height: 120px;
  background: rgba(0, 170, 19, 0.1);
  border-radius: 50%;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.nav-btn {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.nav-btn:hover,
.nav-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.nav-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid var(--dark);
}

/* Greeting */
.greeting {
  color: var(--white);
  position: relative;
  z-index: 1;
}

.greeting-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.greeting-time .icon {
  font-size: 16px;
  color: #FFD93D;
}

.greeting-name {
  font-size: 22px;
  font-weight: 700;
}

/* Search Bar */
.search-wrapper {
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: var(--transition);
}

.search-bar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.search-bar .icon {
  color: var(--primary);
  font-size: 22px;
}

.search-bar span {
  color: var(--gray-500);
  font-size: 14px;
}

/* =====================================================
   SERVICES SECTION
   ===================================================== */
.services-section {
  padding: 24px 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

/* Service Cards Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--gray-900);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.service-card:active {
  transform: scale(0.95);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon .icon {
  font-size: 26px;
}

/* Service Icon Colors */
.service-icon.ojek {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
}

.service-icon.ojek .icon {
  color: #F57C00;
}

.service-icon.mobil {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
}

.service-icon.mobil .icon {
  color: #1976D2;
}

.service-icon.kurir {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}

.service-icon.kurir .icon {
  color: #388E3C;
}

.service-icon.food {
  background: linear-gradient(135deg, #FCE4EC, #F8BBD0);
}

.service-icon.food .icon {
  color: #C2185B;
}

.service-label {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* =====================================================
   PROMO SECTION
   ===================================================== */
.promo-section {
  padding: 10px 0 20px;
  width: 100%;
  overflow: hidden;
}

.promo-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 10px;
  gap: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}

.promo-list::-webkit-scrollbar {
  display: none;
}

.promo-card,
.promo-banner {
  flex: 0 0 85%;
  min-width: 85%;
  scroll-snap-align: center;
}

.promo-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}

.promo-card::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.promo-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 8px;
  align-self: flex-start;
  text-transform: uppercase;
}

.promo-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.promo-desc {
  font-size: 13px;
  opacity: 0.9;
}

.promo-banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  line-height: 0;
  display: flex;
  align-items: center;
}

.promo-banner:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.promo-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =====================================================
   ORDER SCREEN
   ===================================================== */
.order-screen {
  padding-bottom: 100px;
}

/* Order Header */
.order-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  padding-top: calc(14px + var(--safe-top));
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 40px;
  height: 40px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-800);
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--gray-200);
}

.order-title {
  font-size: 17px;
  font-weight: 700;
}

.order-service-badge {
  margin-left: auto;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Map */
.map-container {
  position: relative;
  height: 260px;
  background: var(--gray-200);
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  width: 44px;
  height: 44px;
  background: var(--white);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  transition: var(--transition);
}

.map-btn:hover {
  transform: scale(1.1);
}

/* Location Card */
.location-card {
  background: var(--white);
  margin: -24px 16px 0;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
}

.location-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.location-item:not(:last-child) {
  border-bottom: 1px dashed var(--gray-200);
}

.location-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.location-dot.pickup {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 170, 19, 0.15);
}

.location-dot.dropoff {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
}

.location-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  outline: none;
}

.location-input::placeholder {
  color: var(--gray-400);
}

.input-icon {
  font-size: 18px;
  color: var(--gray-300);
  margin-left: 8px;
  flex-shrink: 0;
  transition: var(--transition);
}

.location-input:focus+.input-icon {
  color: var(--primary);
  transform: translateX(2px);
}

/* Form */
.order-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
}

.form-card-header .icon {
  font-size: 20px;
  color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-900);
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 170, 19, 0.1);
}

.form-textarea {
  resize: none;
  min-height: 80px;
}

/* Price Display */
.price-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.price-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  animation: price-pulse 3s ease-in-out infinite;
}

@keyframes price-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.price-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 4px;
  position: relative;
}

.price-amount {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
}

.price-meta {
  font-size: 13px;
  opacity: 0.85;
  position: relative;
}

/* Bottom Actions */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--white);
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 12px;
  z-index: 100;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn .icon {
  font-size: 20px;
}

/* =====================================================
   BOTTOM NAVIGATION
   ===================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: calc(10px + var(--safe-bottom));
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  text-decoration: none;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.nav-item .icon {
  font-size: 24px;
}

/* =====================================================
   UTILITIES
   ===================================================== */

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Material Icons */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}