/* ============================================
   Design System - Aplikasi Pemesanan Tiket Bus
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors - Primary */
  --color-primary: #1a1a2e;
  --color-primary-light: #16213e;
  --color-primary-dark: #0f0f1e;
  
  /* Colors - Accent (Gold) */
  --color-accent: #f5a623;
  --color-accent-hover: #e09516;
  --color-accent-light: #ffecd2;
  --color-accent-dark: #c4841c;
  
  /* Colors - Secondary (Blue) */
  --color-secondary: #3b82f6;
  --color-secondary-light: #dbeafe;
  --color-secondary-hover: #2563eb;
  
  /* Colors - Background */
  --bg-primary: #ffffff;
  --bg-secondary: #f0f4ff;
  --bg-tertiary: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark: #1a1a2e;
  
  /* Colors - Text */
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-white: #ffffff;
  --text-accent: #f5a623;
  
  /* Colors - Status */
  --color-success: #10b981;
  --color-success-bg: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-error: #ef4444;
  --color-error-bg: #fee2e2;
  --color-info: #3b82f6;
  --color-info-bg: #dbeafe;
  
  /* Colors - Border */
  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
  --border-color-focus: #3b82f6;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', 'Inter', sans-serif;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 12px rgba(26, 26, 46, 0.06);
  --shadow-card-hover: 0 8px 30px rgba(26, 26, 46, 0.12);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 500;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 1100;

  /* Layout */
  --container-max: 1200px;
  --navbar-height: 72px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

a {
  text-decoration: none;
  color: var(--color-secondary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-secondary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  transition: all var(--transition-base);
}

input, select, textarea {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  outline: none;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   Utility Classes
   ============================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-accent-hover), var(--color-accent-dark));
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-primary);
  color: var(--text-white);
}

.btn-secondary:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--color-primary);
  background: var(--bg-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-body {
  padding: var(--space-6);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-gold {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.badge-blue {
  background: var(--color-secondary-light);
  color: var(--color-secondary);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-6) 0;
}

.divider-dashed {
  border-top-style: dashed;
}

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Spacing */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Stagger animation delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   Toast / Notification
   ============================================ */
.toast-container {
  position: absolute;
  top: 16px;
  left: 12px;
  right: 12px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--text-white);
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease, fadeIn 0.3s ease;
  min-width: auto;
  text-align: center;
}

.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-error); }
.toast-warning { background: var(--color-warning); }
.toast-info { background: var(--color-info); }

/* ============================================
   Mobile Container & Responsive Layout
   ============================================ */

/* Global viewport wrapper */
#app-wrapper {
  background-color: #e2e8f0; /* slate-200 background for desktop */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* App Mobile Column Container (Centered on desktop, fullscreen on mobile) */
.app-mobile-container {
  width: 440px;
  height: 100vh;
  background-color: #f8fafc;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-mobile-container.full-screen-layout {
  width: 100vw !important;
  max-width: 100% !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

/* Phone Content viewport area */
.phone-viewport-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  scrollbar-width: none; /* Hide scrollbar on Firefox */
}

.phone-viewport-content::-webkit-scrollbar {
  display: none; /* Hide scrollbar on Chrome/Safari */
}

/* Bottom Navigation Bar */
.phone-bottom-nav {
  height: 64px;
  background-color: #06D001; /* Neon green background matching brand */
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  z-index: 1000;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.08);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.7); /* White text with opacity for inactive state */
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
}

.bottom-nav-item svg, .bottom-nav-item i {
  color: rgba(255, 255, 255, 0.7); /* White icon with opacity for inactive state */
  transition: all 0.2s ease;
}

/* Hover state: make it white */
.bottom-nav-item:hover {
  color: #ffffff !important;
}

.bottom-nav-item:hover svg, .bottom-nav-item:hover i {
  color: #ffffff !important;
}

.bottom-nav-item-active {
  color: #ffffff !important;
}

.nav-icon-capsule {
  width: 48px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.bottom-nav-item-active .nav-icon-capsule {
  background-color: #ffffff; /* White active capsule on green background */
}

.bottom-nav-item-active svg, .bottom-nav-item-active i {
  color: #06D001 !important; /* Green icon inside white capsule */
}

/* Responsive: Fullscreen on mobile devices */
@media (max-width: 480px) {
  #app-wrapper {
    background-color: #f8fafc;
  }
  
  .app-mobile-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}
