/* ANA TOKTOK - Full Web App Styles */
:root {
  --primary: #ff6b00;
  --primary-dark: #e55f00;
  --primary-light: #fff0e0;
  --success: #28a745;
  --danger: #dc3545;
  --text: #1a1a2e;
  --muted: #888;
  --bg: #f5f7fa;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ========== Common ========== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 16px;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Cairo', sans-serif;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.35);
}

.btn-primary:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-green {
  background: #25d366;
  color: white;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-top: 8px;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
}

.back-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: white;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* ========== Home Screen ========== */
#screen-home {
  text-align: center;
  justify-content: center;
  padding: 24px 20px;
}

.logo-circle {
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  box-shadow: 0 10px 30px rgba(255, 107, 0, 0.35);
}

.brand {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.route-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 14px 22px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
  margin: 0 auto 8px;
}

.route-card .from {
  color: var(--primary);
}

.route-card .arrow {
  color: var(--muted);
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

/* ========== Request Ride ========== */
.input-group {
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: white;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  box-shadow: var(--shadow);
}

.input-group input:focus {
  outline: 2px solid var(--primary);
}

.quick-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.quick-label {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.chip {
  background: white;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:active,
.chip.active {
  background: var(--primary);
  color: white;
}

.loc-row {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}

.loc-row .label {
  color: var(--muted);
  min-width: 30px;
}

.loc-row strong {
  font-weight: 600;
}

.passengers-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.passengers-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.passengers-controls button {
  width: 36px;
  height: 36px;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passengers-controls span {
  font-size: 20px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.price-box {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.price-box .amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.meta {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ========== Searching ========== */
#screen-searching {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.spinner {
  width: 64px;
  height: 64px;
  border: 5px solid #ffe0c0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 28px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-text {
  font-size: 15px;
  color: var(--muted);
  margin-top: 12px;
  min-height: 24px;
}

/* ========== Ride Found ========== */
.driver-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  padding: 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.driver-avatar {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.driver-info h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.driver-info p {
  font-size: 13px;
  color: var(--muted);
}

.driver-info .rating {
  color: #f5a623;
  font-weight: 600;
  margin-top: 4px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span:first-child {
  color: var(--muted);
}

.detail-row span:last-child {
  font-weight: 600;
}

.actions-row {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

/* ========== Tracking ========== */
.map-placeholder {
  flex: 1;
  background: linear-gradient(180deg, #e8f4fc, #d4eaf7);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  min-height: 280px;
}

.map-placeholder .toktok {
  font-size: 48px;
}

.eta-text {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ========== Completed ========== */
#screen-completed {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.completed-icon {
  font-size: 70px;
  margin-bottom: 16px;
}

.final-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 28px;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 28px;
}

.star {
  font-size: 36px;
  cursor: pointer;
  color: #ddd;
  transition: color 0.15s;
}

.star.active {
  color: #f5a623;
}

/* ========== Driver Mode ========== */
.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  transition: all 0.2s;
}

.status-toggle.offline {
  background: #eee;
  color: #666;
}

.status-toggle.online {
  background: var(--success);
  color: white;
}

.request-card {
  border: 3px solid var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(255, 107, 0, 0); }
}

.tip {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: auto;
  padding: 16px 0;
}

/* Utility */
.mt-auto { margin-top: auto; }
.text-center { text-align: center; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* Payment options */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #eee;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.pay-option input {
  accent-color: var(--primary);
}

.pay-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Price breakdown */
.price-breakdown .total-row {
  font-weight: 700;
  font-size: 15px;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
  margin-top: 4px;
}

.price-breakdown .amount {
  color: var(--primary);
  font-size: 18px;
}

/* ========== Map View ========== */
.map-view {
  width: 100%;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  background: #e8f4fc;
  z-index: 1;
}

.map-view-tall {
  height: 280px;
}

.map-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Leaflet inside RTL app */
.leaflet-container {
  font-family: 'Cairo', sans-serif;
  direction: ltr;
}

/* Driver ID registration */
.id-preview-box {
  width: 100%;
  min-height: 160px;
  border: 2px dashed #ccc;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: #fafafa;
  margin-bottom: 10px;
}

.id-preview-box:active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.id-placeholder {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.id-placeholder p {
  margin-top: 8px;
  font-size: 13px;
}

.id-preview-img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}
