/* ============================================================
   JamuAI — Modern 3D & Mobile-First Design System (v2.0)
   Designed by UI/UX Expert
   Includes: Glassmorphism, 3D Canvas Integration, PWA Safe Areas,
   Micro-interactions, Bottom Navigation, Accessible Touch Targets
   ============================================================ */

:root {
  /* Brand Palettes - Deep Forest & Modern Emerald */
  --primary-900: #0a1c14;
  --primary-800: #143628;
  --primary-700: #1e523c;
  --primary-600: #2d6a4f;
  --primary-500: #40916c;
  --primary-400: #52b788;
  --primary-300: #74c69d;
  --primary-200: #b7e4c7;
  --primary-100: #d8f3dc;
  --primary-50:  #f0faf3;

  /* Accent & Gold Traditional Nuance */
  --accent-gold:   #f59e0b;
  --accent-amber:  #d97706;
  --accent-glow:   rgba(245, 158, 11, 0.35);

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  /* Neutral & Dark Elements */
  --surface-dark:     #0d1f18;
  --surface-card:     #ffffff;
  --surface-subtle:   #f8faf9;
  --border-subtle:    rgba(0, 0, 0, 0.08);
  --border-glass:     rgba(255, 255, 255, 0.18);
  
  --text-main:    #1f2937;
  --text-muted:   #6b7280;
  --text-inverse: #ffffff;

  /* Elevation & 3D Glass */
  --glass-bg:         rgba(255, 255, 255, 0.85);
  --glass-bg-dark:    rgba(14, 38, 28, 0.75);
  --glass-border:     1px solid rgba(255, 255, 255, 0.4);
  --glass-blur:       blur(16px);
  --shadow-subtle:    0 4px 20px -2px rgba(10, 28, 20, 0.06);
  --shadow-float:     0 12px 30px -4px rgba(10, 28, 20, 0.14), 0 4px 10px rgba(0, 0, 0, 0.03);
  --shadow-3d:        0 20px 40px -8px rgba(10, 28, 20, 0.22), 0 0 15px rgba(82, 183, 136, 0.15);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Base Reset & Mobile-First setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--surface-subtle);
  color: var(--text-main);
  line-height: 1.55;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
  min-height: 100vh;
  padding-bottom: calc(75px + var(--safe-bottom)); /* Spacer untuk Bottom Navigation Mobile */
}

/* ============================================================
   TOP APP BAR (Clean Native Mobile Header)
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 28, 20, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: calc(env(safe-area-inset-top, 0px) + 0.65rem) 1.25rem 0.65rem;
  transition: var(--transition-smooth);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-badge-3d {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2d6a4f, #143628);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-title-group h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-title-group h1 span {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.brand-title-group p {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.2;
  margin-top: 2px;
}

/* Navigasi Desktop (Otomatis disembunyikan sepenuhnya di Mobile/PWA) */
.desktop-nav {
  display: none;
}

@media (min-width: 992px) {
  .desktop-nav {
    display: flex;
    gap: 0.4rem;
    list-style: none;
  }
}

.desktop-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.desktop-nav a:hover,
.desktop-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Install PWA Button in Header */
.btn-pwa-install {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #111;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: var(--transition-fast);
}

.btn-pwa-install.show {
  display: inline-flex;
}

.btn-pwa-install:active {
  transform: scale(0.96);
}

/* ============================================================
   3D HERO SECTION (IMMERSIVE BOTANICAL STAGE)
   ============================================================ */
.hero-stage {
  position: relative;
  background: radial-gradient(circle at 50% 30%, #153c2c 0%, #0a1c14 85%);
  color: #fff;
  padding: 2rem 1rem 3.5rem;
  overflow: hidden !important;
  width: 100%;
  max-width: 100vw;
  text-align: center;
}

#canvas-3d-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: auto;
}

#canvas-3d-container canvas {
  width: 100% !important;
  max-width: 100vw !important;
  height: 100% !important;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  pointer-events: none;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-200);
  margin-bottom: 0.85rem;
}

.hero-content h2 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-content h2 .gradient-text {
  background: linear-gradient(135deg, #a7f3d0 0%, #fef08a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* ============================================================
   FLOATING 3D GLASS SEARCH CARD
   ============================================================ */
.search-wrapper {
  max-width: 760px;
  width: 100%;
  margin: -2.8rem auto 1.5rem;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

.search-glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-3d);
  width: 100%;
  box-sizing: border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.search-glass-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 24px 45px -8px rgba(10, 28, 20, 0.28), 0 0 20px rgba(82, 183, 136, 0.25);
}

.search-box-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-group-3d {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group-3d .search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.2rem;
  color: var(--primary-600);
  pointer-events: none;
}

.search-input-modern {
  width: 100%;
  border: 1.5px solid rgba(45, 106, 79, 0.2);
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: var(--transition-fast);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-input-modern:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.2);
}

.btn-search-glow {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(45, 106, 79, 0.35);
  transition: var(--transition-smooth);
}

.btn-search-glow:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.45);
  transform: translateY(-1px);
}

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

.btn-search-glow:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Quick Chips Container */
.chips-scroller {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0 0.2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chips-scroller::-webkit-scrollbar {
  display: none;
}

.chip-pill {
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.15);
  color: var(--primary-800);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chip-pill:hover,
.chip-pill:active {
  background: var(--primary-100);
  border-color: var(--primary-400);
  transform: translateY(-1px);
}

/* ============================================================
   RESPONSIVE APP CONTAINER
   ============================================================ */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.layout-grid {
  display: grid;
  grid-template-columns: 100%;
  width: 100%;
  gap: 1.25rem;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .layout-grid {
    grid-template-columns: 290px 1fr;
    align-items: start;
  }
}

/* Sidebar on Desktop */
.app-sidebar {
  display: none;
}

@media (min-width: 992px) {
  .app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 75px;
  }
}

/* Modern Glass Card Component */
.ui-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ui-card-header {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ui-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-900);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ui-card-body {
  padding: 1.15rem;
}

/* Stats Widget */
.stats-grid-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat-box {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.4rem;
  text-align: center;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-700);
  line-height: 1;
}

.stat-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* History List Sidebar */
.sidebar-history-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
}

.history-entry {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  transition: var(--transition-fast);
}

.history-entry:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.history-entry span.txt {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-entry span.ago {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================================
   RESULTS CONTENT AREA
   ============================================================ */
#results-area {
  min-height: 380px;
}

/* Result Hero Ribbon */
.result-banner-3d {
  background: linear-gradient(135deg, #0f2c20 0%, #0a1c14 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(82, 183, 136, 0.2);
  position: relative;
  overflow: hidden;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.result-banner-3d * {
  max-width: 100% !important;
  box-sizing: border-box !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.result-banner-3d::after {
  content: '🌿';
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 6rem;
  opacity: 0.05;
  pointer-events: none;
}

.banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.banner-title-area {
  flex: 1;
  min-width: 0; /* Hindari min-width memicu overflow horizontal di mobile */
}

.banner-badge-mini {
  display: inline-block;
  background: rgba(116, 198, 157, 0.15);
  color: #a7f3d0;
  border: 1px solid rgba(116, 198, 157, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.banner-keluhan-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
  text-transform: capitalize;
}

.banner-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-action-icon {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Kotak Paragraf Ringkasan Klinis yang Rapi dan Nyaman Dibaca */
.banner-summary-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
  margin-bottom: 0.85rem;
}

.banner-summary-box p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.7;
  letter-spacing: 0.01em;
  margin: 0;
  text-align: left;
}

.banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Segmented Mobile Scroll Tabs (Modern Pill Bar) */
.tabs-scroll-wrapper {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.45rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.tabs-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  padding: 2px;
}

.tab-pill-btn {
  border: none;
  background: transparent;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.tab-pill-btn:hover {
  background: var(--surface-subtle);
  color: var(--text-main);
}

.tab-pill-btn.active {
  background: var(--primary-700) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(30, 82, 60, 0.25);
}

/* ============================================================
   RECIPE CARD ENHANCEMENTS (TIERED CARDS)
   ============================================================ */
.recipe-card-3d {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-float);
  margin-bottom: 1.25rem;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recipe-card-3d:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3d);
}

.recipe-card-3d.tier-1-border {
  border-top: 5px solid #10b981;
}

.recipe-card-3d.tier-2-border {
  border-top: 5px solid #f59e0b;
}

.recipe-card-3d.tier-3-border {
  border-top: 5px solid #8b5cf6;
}

.recipe-header-bar {
  padding: 1rem 1.25rem;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-800);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.tier-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.tier-1-badge { background: #dcfce7; color: #15803d; }
.tier-2-badge { background: #fef3c7; color: #b45309; }
.tier-3-badge { background: #ede9fe; color: #6d28d9; }

.recipe-body-padded {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.section-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Ingredients Grid */
.grid-ingredients-mobile {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 600px) {
  .grid-ingredients-mobile {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ing-badge-item {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ing-badge-item .ing-icon {
  font-size: 1.3rem;
}

.ing-badge-item .ing-text h6 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-900);
}

.ing-badge-item .ing-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Timeline Recipe Preparation */
.steps-timeline {
  list-style: none;
  position: relative;
  padding-left: 1rem;
}

.steps-timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 17px;
  width: 2px;
  background: var(--primary-100);
}

.timeline-step {
  position: relative;
  display: flex;
  gap: 0.85rem;
  padding: 0.5rem 0;
  font-size: 0.88rem;
}

.timeline-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-600);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

/* Dosage Callout 3D */
.dosage-card-callout {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 480px) {
  .dosage-card-callout {
    grid-template-columns: 1fr 1fr;
  }
}

.dose-field .df-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-amber);
}

.dose-field .df-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #78350f;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Mechanism Box */
.mechanism-pill {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.84rem;
  color: #0369a1;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ============================================================
   LOADING & EMPTY STATE
   ============================================================ */
.loading-box-3d {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-subtle);
}

.loading-herb-spinner {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.loading-herb-spinner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid var(--primary-100);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

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

/* ============================================================
   MOBILE BOTTOM NAVIGATION BAR (PWA NATIVE FEEL)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  padding: 0.45rem 1rem calc(0.45rem + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

@media (min-width: 992px) {
  .bottom-nav {
    display: none; /* Sembunyikan di layar laptop/desktop */
  }
  body {
    padding-bottom: 0;
  }
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.bnav-item .bnav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.bnav-item.active {
  color: var(--primary-700);
}

.bnav-item.active .bnav-icon {
  transform: translateY(-2px);
}

/* ============================================================
   TOAST & MICRO NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  background: var(--primary-800);
  color: #fff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-3d);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.error { background: #dc2626; }
.toast.warning { background: #d97706; }

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
