/* ==========================================================================
   Kiatan TravelFlow (Initium v2.0.14) — Official Web & 1:1 Android PWA Styles
   Matches Color.kt, Theme.kt, Type.kt, and TravelFlowApp.kt
   ========================================================================== */

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

:root {
  /* Core Android Color.kt Palette */
  --bg-dark: #081425;
  --surface-dark: #081425;
  --surface-variant: #2A3548;
  --card-dark: #152031;
  --card-elevated: #1E293B;
  --card-onboarding: #132238;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.14);
  --border-onboarding: #233654;

  /* Brand & Semantic Accents */
  --primary: #2DD4BF;
  --on-primary: #003731;
  --primary-container: rgba(45, 212, 191, 0.16);
  --secondary: #C0C1FF;
  --secondary-container: #3131C0;
  --tertiary: #FFD29F;
  --tertiary-container: #FFAD3A;

  /* Text Hierarchy */
  --text-heading: #FFFFFF;
  --text-body: #B0BEC5;
  --text-muted: #6B7A8D;
  --text-accent: #2DD4BF;

  /* Readiness Status Badges */
  --status-planning-bg: rgba(211, 47, 47, 0.22);
  --status-planning-fg: #FFB4AB;
  --status-partial-bg: rgba(253, 216, 53, 0.20);
  --status-partial-fg: #FFD29F;
  --status-booked-bg: rgba(56, 142, 60, 0.25);
  --status-booked-fg: #57F1DB;
  --status-completed-bg: rgba(117, 117, 117, 0.25);
  --status-completed-fg: #BDBDBD;

  /* Danger / Warning / Success */
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-heading);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 20, 37, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.28);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.5);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Surfaces & Cards */
.kiatan-surface {
  background-color: var(--bg-dark);
}

.kiatan-card {
  background-color: var(--card-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kiatan-card:hover {
  border-color: rgba(45, 212, 191, 0.32);
}

.kiatan-card-elevated {
  background-color: var(--card-elevated);
  border: 1px solid var(--border-card);
  border-radius: 16px;
}

.kiatan-onboarding-card {
  background: linear-gradient(180deg, #1A2A44 0%, #0F1F35 100%);
  border: 1px solid var(--border-onboarding);
  border-radius: 20px;
}

.kiatan-glass {
  background: rgba(21, 32, 49, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* Buttons & Interactive Controls */
.btn-teal {
  background-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  border-radius: 14px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 18px rgba(45, 212, 191, 0.22);
}
.btn-teal:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(45, 212, 191, 0.34);
}
.btn-teal:active:not(:disabled) {
  transform: translateY(0);
}
.btn-teal:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline-glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 14px;
  transition: all 0.18s ease;
}
.btn-outline-glass:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(45, 212, 191, 0.08);
}

/* Form Inputs matching Android OutlinedTextField */
.kiatan-input {
  width: 100%;
  background-color: #0D1B2E;
  border: 1px solid #2A3C58;
  border-radius: 14px;
  padding: 12px 15px;
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kiatan-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.16);
}
.kiatan-input::placeholder {
  color: var(--text-muted);
}

/* Status Pills (JourneyListScreen.kt) */
.status-pill-planning {
  background: var(--status-planning-bg);
  color: var(--status-planning-fg);
  border: 1px solid rgba(255, 180, 171, 0.35);
}
.status-pill-partial {
  background: var(--status-partial-bg);
  color: var(--status-partial-fg);
  border: 1px solid rgba(255, 210, 159, 0.35);
}
.status-pill-booked {
  background: var(--status-booked-bg);
  color: var(--status-booked-fg);
  border: 1px solid rgba(87, 241, 219, 0.35);
}
.status-pill-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed-fg);
  border: 1px solid rgba(189, 189, 189, 0.3);
}

/* Role Badges */
.role-badge-owner {
  background: rgba(99, 102, 241, 0.24);
  color: #C0C1FF;
  border: 1px solid rgba(192, 193, 255, 0.4);
}
.role-badge-editor {
  background: rgba(45, 212, 191, 0.18);
  color: #2DD4BF;
  border: 1px solid rgba(45, 212, 191, 0.4);
}
.role-badge-viewer {
  background: rgba(255, 255, 255, 0.08);
  color: #B0BEC5;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   DESKTOP vs. MOBILE PWA ISOLATION (Rule #9 Strict Media Query Isolation)
   - Desktop (>= 768px): Left Glass Navigation Rail + Multi-Pane Workspace
   - Mobile & Installed Home-Screen PWA (< 768px): 1:1 Android App Clone with
     Floating Rounded-Pill Bottom Navigation Bar & Expandable FAB
   ========================================================================== */

@media (min-width: 768px) {
  .mobile-only-nav,
  .mobile-only-element {
    display: none !important;
  }
  .desktop-only-rail {
    display: flex !important;
  }
  .app-main-content {
    padding-bottom: 32px;
  }
}

@media (max-width: 767px) {
  .desktop-only-rail,
  .desktop-only-element {
    display: none !important;
  }
  .mobile-only-nav {
    display: flex !important;
  }
  .app-main-content {
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 12px));
  }

  /* 1:1 Android TravelFlowBottomBar (TravelFlowApp.kt) */
  .android-bottom-pill-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 4px));
    height: 72px;
    border-radius: 32px;
    background: rgba(16, 26, 42, 0.86);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
      0 0 28px rgba(45, 212, 191, 0.25),
      0 12px 32px rgba(0, 0, 0, 0.65);
    z-index: 50;
    transition: height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.24s ease;
  }

  /* Shrunk state on scroll down (matches TravelFlowBottomBar isShrunk = true) */
  .android-bottom-pill-bar.shrunk {
    height: 54px;
    border-radius: 24px;
    left: 28px;
    right: 28px;
  }
  .android-bottom-pill-bar.shrunk .nav-tab-label {
    display: none;
  }

  /* Floating Action Button positioned above bottom pill bar on mobile */
  .android-fab-container {
    bottom: calc(96px + env(safe-area-inset-bottom, 8px)) !important;
    right: 18px !important;
  }
}

/* Desktop FAB position */
@media (min-width: 768px) {
  .android-fab-container {
    bottom: 28px;
    right: 32px;
  }
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(45, 212, 191, 0);
  }
}

.pulse-teal {
  animation: pulseGlow 2.4s infinite;
}

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

.animate-screen {
  animation: fadeInSlide 0.22s ease-out;
}
