/* ==========================================================================
   OKAYS RIDERS - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Carbon Dark, Electric Orange, Glassmorphism, Premium Mobile-First
   ========================================================================== */

:root {
  --bg-dark: #0b0d10;
  --bg-card: #14171d;
  --bg-card-hover: #1c2029;
  --bg-input: #1a1e27;
  
  --primary-orange: #ff5e00;
  --primary-orange-glow: rgba(255, 94, 0, 0.35);
  --primary-amber: #ff9d00;
  --primary-dark-orange: #cc4b00;

  --text-main: #f5f6f8;
  --text-muted: #8a94a6;
  --text-dim: #5a6474;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 94, 0, 0.3);

  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-orange: 0 8px 25px rgba(255, 94, 0, 0.3);
}

/* Reset & Base Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea, a, .btn, .nav-item, .grid-card, .menu-item, .modal-close-btn {
  user-select: auto;
  cursor: pointer;
  pointer-events: auto;
}

body {
  font-family: var(--font-main);
  background-color: #040507;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout Wrapper for Desktop Centering */
.app-layout-wrapper {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  max-height: 940px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

/* Mobile Smartphone Frame Simulation */
.mobile-frame {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  border-radius: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 8px #1f242d;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Top Status Bar */
.status-bar {
  height: 38px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 100;
  background-color: var(--bg-dark);
}

.notch {
  width: 120px;
  height: 18px;
  background-color: #000;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
}

.status-icons {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
}

/* App Header */
.app-header {
  height: 58px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 13, 16, 0.85);
  backdrop-filter: blur(12px);
  z-index: 90;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.header-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-orange);
  box-shadow: 0 0 10px var(--primary-orange-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-main {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-main);
}

.brand-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-orange);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--primary-orange);
  color: #fff;
}

/* Main Content Area */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 110px;
  position: relative;
}

.main-content::-webkit-scrollbar {
  width: 4px;
}
.main-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Page Views */
.page-view {
  display: none;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Crest Banner & Emblem */
.hero-crest-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0 20px;
}

.hero-logo-card {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary-orange);
  box-shadow: 0 0 35px var(--primary-orange-glow);
  background: #000;
  margin-bottom: 20px;
}

.official-crest-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 320px;
  margin-bottom: 16px;
}

.hero-btn-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dual-btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Buttons */
.btn {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-dark-orange));
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 94, 0, 0.4);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.78rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-orange {
  background: rgba(255, 94, 0, 0.15);
  color: var(--primary-orange);
  border: 1px solid rgba(255, 94, 0, 0.3);
}

.badge-dark {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Section Containers */
.section-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
}

.see-all-link {
  font-size: 0.78rem;
  color: var(--primary-orange);
  text-decoration: none;
  font-weight: 600;
}

/* Ride Cards */
.ride-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.ride-card-image {
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ride-card-body {
  padding: 14px;
}

.ride-card-body h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.ride-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ride-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.avatars-group {
  display: flex;
  align-items: center;
}

.avatars-group img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--bg-dark);
  margin-right: -6px;
}

.avatar-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 12px;
}

/* Quick Hub Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.grid-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 0.2s ease;
}

.grid-card:active {
  background: var(--bg-card-hover);
  border-color: var(--primary-orange);
}

.grid-card i {
  font-size: 1.4rem;
}

.grid-card span {
  font-size: 0.78rem;
  font-weight: 600;
}

/* Stats Strip */
.stats-strip {
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-orange);
  display: block;
}

.stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  height: 64px;
  background: rgba(11, 13, 16, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding: 0 10px;
}

@media (max-width: 768px) {
  body {
    padding: 0;
    margin: 0;
    align-items: stretch;
  }
  .app-layout-wrapper {
    max-width: 100%;
    height: 100vh;
    padding: 0;
  }
  .mobile-frame {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  .status-bar,
  .notch {
    display: none !important;
  }
  .bottom-nav {
    max-width: 100%;
    left: 0;
    transform: none;
    position: fixed !important;
    bottom: 0 !important;
  }
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  flex: 1;
  transition: color 0.2s ease;
}

.nav-item i {
  font-size: 1.15rem;
}

.nav-item.active {
  color: var(--primary-orange);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-btn, .category-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.filter-btn.active, .category-pill.active {
  background: var(--primary-orange);
  color: #fff;
  border-color: var(--primary-orange);
}

/* Form Styling */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea, .search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-orange);
}

/* Checkbox */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.4;
}

.custom-checkbox input {
  accent-color: var(--primary-orange);
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* Progress Bar Track */
.progress-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-orange), var(--primary-amber));
  transition: width 0.3s ease;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.step-actions {
  margin-top: 20px;
}

.step-actions.dual {
  display: flex;
  gap: 10px;
}

.step-actions.dual .btn {
  flex: 1;
}

/* Modals */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-height: 85vh;
  background: var(--bg-dark);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 20px 20px 130px 20px;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
  position: relative;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Center OTP Modal in the middle of the screen */
#otpModal.modal-backdrop {
  align-items: center;
  justify-content: center;
}

#otpModal .modal-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--primary-orange);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
  max-width: 380px;
  width: 90%;
  margin: 0 16px;
  animation: zoomInCenter 0.25s ease;
}

@keyframes zoomInCenter {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
#sosModal.modal-backdrop,
#notifModal.modal-backdrop {
  align-items: flex-start;
}

#sosModal .modal-card,
#notifModal .modal-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  border-top: none;
  border-bottom: 2px solid var(--primary-orange);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85);
  animation: slideDownFromTop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFromTop {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
}

/* Menu Lists */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.85rem;
}

/* Toast Notification */
.okays-toast {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(20, 23, 29, 0.95);
  border: 1px solid var(--primary-orange);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  z-index: 999;
  box-shadow: var(--shadow-orange);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.okays-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Utility Helpers */
.text-orange { color: var(--primary-orange); }
.text-amber { color: var(--primary-amber); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

/* Grid Gallery & Products */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-item {
  height: 140px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.product-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.cart-trigger-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary-orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Leaderboard Podium */
.leaderboard-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin: 20px 0;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  border: 1px solid var(--border-color);
  width: 90px;
}

.podium-item.item-1 {
  border-color: var(--primary-amber);
  transform: translateY(-10px);
}

.podium-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  margin: 6px 0;
}

.podium-name {
  font-size: 0.75rem;
  font-weight: 700;
}

.podium-km {
  font-size: 0.7rem;
  font-weight: 800;
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  padding-left: 38px;
}

.admin-header-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border-color);
}

.metric-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 4px;
  display: block;
}

.applicant-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
