/* ==========================================
   GLOBAL RESET & VARIABLES
========================================== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent; }
:root { --ease: cubic-bezier(0.22, 1, 0.36, 1); }
body { height: 100dvh; width: 100vw; overflow: hidden; background: #fdfbf7; color: #4a0e17; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }

/* ==========================================
   1. TOP COMMAND HEADER
========================================== */
#app-header { position: absolute; top: 0; left: 0; width: 100vw; display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; height: 65px; background: rgba(253, 251, 247, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(212, 175, 55, 0.3); z-index: 5000; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.header-left, .header-center, .header-right { flex: 1; display: flex; align-items: center; }
.header-center { justify-content: center; }
.header-right { justify-content: flex-end; }
#map-title h1 { font-family: 'Fraunces', serif; font-weight: 700; color: #d92525; }

.mode-toggle-pill { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 20px; display: flex; padding: 4px; }
.mode-toggle-pill button { border: none; background: transparent; padding: 6px 14px; border-radius: 16px; font-weight: 700; font-size: 0.85rem; cursor: pointer; color: #7a1b26; transition: 0.3s; }
.mode-toggle-pill button.active { background: #d92525; color: white; box-shadow: 0 2px 8px rgba(217, 37, 37, 0.3); }

#start-pill-box { position: relative; background: rgba(255,255,255,0.8); border: 1px solid rgba(212,175,55,0.5); border-radius: 20px; padding: 6px 12px; cursor: pointer; transition: 0.3s; }
#start-closed-ui { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #d92525; white-space: nowrap; font-size: 0.9rem;}
#start-expanded-ui { display: none; position: absolute; top: 130%; right: 0; width: 320px; background: #fffcf9; border-radius: 16px; padding: 15px; box-shadow: 0 10px 40px rgba(74, 14, 23, 0.15); border: 1px solid rgba(212,175,55,0.3); flex-direction: column; gap: 12px; cursor: default; }
#start-pill-box.expanded #start-expanded-ui { display: flex; }

/* ==========================================
   2. MAP ZONE & FABs
========================================== */
#map-container { position: absolute; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 1; }
#map { width: 100%; height: 100%; background: #fdfbf7; }
.map-fab-container { position: absolute; right: 15px; bottom: 85px; display: flex; flex-direction: column; gap: 12px; z-index: 1000; transition: bottom 0.3s; }
.map-fab { width: 46px; height: 46px; border-radius: 50%; background: rgba(253, 251, 247, 0.95); border: 1px solid rgba(212, 175, 55, 0.5); box-shadow: 0 4px 15px rgba(74, 14, 23, 0.15); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; backdrop-filter: blur(8px); }
.map-fab svg { fill: #4a0e17; width: 24px; height: 24px; }
.leaflet-control-container .leaflet-bottom.leaflet-left { display: none; }

/* ==========================================
   3. THE EXPLORE PANEL
========================================== */
.explore-panel { position: fixed; bottom: 65px; left: 0; width: 100vw; height: 40dvh; min-height: 12dvh; background: rgba(253, 251, 247, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 32px 32px 0 0; box-shadow: 0 -10px 40px rgba(74, 14, 23, 0.15); z-index: 2000; display: flex; flex-direction: column; overflow: hidden; transition: height 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
.toran-border { position: absolute; top: 0; left: 0; right: 0; height: 16px; background: radial-gradient(circle at 10px 0, #d4af37 8px, transparent 9px); background-size: 20px 16px; background-repeat: repeat-x; z-index: 12; pointer-events: none; border-top-left-radius: 32px; border-top-right-radius: 32px; }
#drag-area { display: flex; justify-content: center; align-items: center; padding: 18px 0 8px; flex-shrink: 0; cursor: grab; touch-action: none; position: relative; z-index: 11; }
.drag-handle { width: 42px; height: 5px; background: rgba(122, 27, 38, 0.28); border-radius: 3px; }
.search-container { padding: 0 15px 12px; flex-shrink: 0; }
#search-box { width: 100%; padding: 12px 16px; background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 12px; color: #4a0e17; outline: none; transition: 0.3s; font-size: 0.95rem; }
#search-box:focus { border-color: #d92525; background: #fff; box-shadow: 0 0 0 3px rgba(217, 37, 37, 0.1); }
.panel-filters { display: flex; gap: 8px; overflow-x: auto; padding: 0 15px 12px; flex-shrink: 0; -ms-overflow-style: none; scrollbar-width: none; }
.panel-filters::-webkit-scrollbar { display: none; }
.filter-chip { flex-shrink: 0; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(212, 175, 55, 0.4); padding: 8px 16px; border-radius: 20px; font-weight: 600; color: #7a1b26; cursor: pointer; transition: 0.2s; font-size: 0.85rem; }
.filter-chip.active { background: #d92525; color: #fff; border-color: #d92525; box-shadow: 0 4px 10px rgba(217, 37, 37, 0.2); }
.chip-divider { width: 2px; background: rgba(212, 175, 55, 0.3); margin: 4px 2px; border-radius: 2px; }
.panel-content { flex-grow: 1; overflow-y: auto; padding: 0 15px 15px; position: relative; }
#pandal-list { list-style: none; }
.pandal-card { background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 12px; padding: 12px 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; cursor: pointer; }
.pandal-card:hover { background: #fff; border-color: #d4af37; box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15); }
.pandal-info h3 { font-size: 0.95rem; color: #4a0e17; font-weight: 600; }
.add-btn { background: transparent; border: 1.5px solid #d92525; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: #d92525; font-size: 0.85rem; transition: 0.2s; }
.add-btn.added { background: #d92525; color: white; box-shadow: 0 4px 10px rgba(217, 37, 37, 0.3); }

/* Unified Proposal / Route Action Bar (Universal Floating Fade) */
#proposal-action-bar { 
  display: none; 
  flex-direction: column; 
  gap: 8px; 
  padding: 40px 20px 20px; 
  background: linear-gradient(to bottom, rgba(253, 251, 247, 0) 0%, rgba(253, 251, 247, 0.9) 45%, rgba(253, 251, 247, 1) 100%);
  border: none;
  z-index: 100; 
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  border-radius: 0 0 50px 50px; /* Curves with the desktop sidebar */
}
body.proposal-mode #proposal-action-bar { display: flex !important; }
#proposal-action-bar.has-visible-btn { display: flex !important; }

/* Re-enable clicking on the actual buttons inside the transparent fade */
#proposal-action-bar > * { pointer-events: auto; }

#cancel-proposal-btn { 
  display: none; 
  width: 100%; 
  background: rgba(255, 255, 255, 0.95); 
  color: #7a1b26; 
  padding: 10px 12px; 
  border-radius: 50px; 
  font-weight: 700; 
  font-size: 0.85rem; 
  border: 1px solid rgba(212, 175, 55, 0.4); 
  cursor: pointer; 
  font-family: inherit; 
  transition: transform 0.2s, background 0.2s; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
#cancel-proposal-btn:hover { background: #fff; border-color: #d92525; color: #d92525; }
#cancel-proposal-btn:active { transform: scale(0.97); }
body.proposal-mode #cancel-proposal-btn { display: block !important; }

#generate-route-btn { 
  width: 100%; 
  background: linear-gradient(135deg, #d4af37, #d92525); 
  color: white; 
  padding: 14px 20px; 
  border-radius: 50px; 
  font-weight: 700; 
  font-size: 1.05rem; 
  border: none; 
  cursor: pointer; 
  box-shadow: 0 8px 25px rgba(217, 37, 37, 0.4); 
  transition: transform 0.2s; 
  display: none; 
}
#generate-route-btn:active { transform: scale(0.97); }

/* ==========================================
   4. BOTTOM NAVIGATION BAR (Floating Pill)
========================================== */
#bottom-nav { 
  position: fixed; 
  bottom: 20px; 
  left: 50%;
  transform: translateX(-50%);
  width: 92vw; 
  max-width: 400px;
  height: 60px; 
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.35); 
  border-radius: 40px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  z-index: 5000; 
  padding: 6px;
  box-shadow: 0 8px 30px rgba(74, 14, 23, 0.15);
}

#bottom-nav::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc((100% - 12px) / 4);
  background: linear-gradient(135deg, #d92525, #b81d24);
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(217, 37, 37, 0.3);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}

#bottom-nav:has(#nav-btn-map.active)::before { transform: translateX(0); }
#bottom-nav:has(#nav-btn-groups.active)::before { transform: translateX(100%); }
#bottom-nav:has(.nav-tab:nth-child(3).active)::before { transform: translateX(200%); }
#bottom-nav:has(.nav-tab:nth-child(4).active)::before { transform: translateX(300%); }

.nav-tab { 
  background: transparent; 
  border: none; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center;
  gap: 4px; 
  color: #94a3b8; 
  cursor: pointer; 
  font-family: 'Outfit'; 
  flex: 1;
  height: 100%;
  position: relative;
  z-index: 2;
  border-radius: 30px;
  transition: color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab.active { color: #ffffff !important; }
.nav-tab.active[style*="color: #d92525"] { color: #ffffff !important; }
.nav-tab .tab-icon { font-size: 1.3rem; margin-bottom: -2px; }
.nav-tab .tab-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

@supports not selector(:has(a)) {
  .nav-tab.active { background: linear-gradient(135deg, #d92525, #b81d24) !important; }
  #bottom-nav::before { display: none; }
}

/* ==========================================
   5. DESKTOP ADAPTATION
========================================== */
@media (min-width: 769px) {
  #bottom-nav { display: none; }
  #map-container { left: 0; width: 100vw; }
  #app-header { top: 15px; left: 15px; width: calc(100vw - 30px); padding: 10px 24px; border-radius: 50px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(235, 80, 50, 0.15)); backdrop-filter: blur(32px) saturate(200%); -webkit-backdrop-filter: blur(32px) saturate(200%); border: 1px solid rgba(255, 210, 190, 0.8); box-shadow: 0 12px 30px rgba(74, 14, 23, 0.15); }
  .explore-panel { top: 95px; bottom: 15px; left: 15px; width: 380px; height: calc(100dvh - 110px) !important; border-radius: 50px !important; overflow: hidden !important; background: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(235, 80, 50, 0.15)) !important; backdrop-filter: blur(32px) saturate(200%); -webkit-backdrop-filter: blur(32px) saturate(200%); border: 1px solid rgba(255, 210, 190, 0.8) !important; box-shadow: 0 16px 40px rgba(74, 14, 23, 0.25) !important; display: flex !important; flex-direction: column !important; }
  .search-container { padding: 35px 15px 10px 15px !important; }
  #filter-chip-container { padding: 0 15px 10px 15px !important; }
  .panel-content { flex: 1; overflow-y: auto; padding: 0 0 15px 0 !important; }
  #pandal-list { padding: 0 15px 180px 15px !important; margin: 0; }
  .panel-content::-webkit-scrollbar { display: block !important; width: 6px; }
  .panel-content::-webkit-scrollbar-track { background: transparent; }
  .panel-content::-webkit-scrollbar-thumb { background: rgba(217, 37, 37, 0.3); border-radius: 10px; }
  #drag-area { display: none; }
  .map-fab-container { bottom: 30px; right: 20px; }
  .leaflet-control-container .leaflet-bottom.leaflet-left { display: block; margin-left: 410px; margin-bottom: 30px; }
}

/* ==========================================
   6. CORE UTILITIES & MODALS
========================================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: rgba(0,0,0,0.5); z-index: 8000; opacity: 0; pointer-events: none; transition: 0.3s; backdrop-filter: blur(4px); }
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.center-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); width: 90%; max-width: 340px; background: rgba(253, 251, 247, 0.98); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 20px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); z-index: 8100; opacity: 0; pointer-events: none; transition: 0.3s var(--ease); display: flex; flex-direction: column; text-align: center; }
.center-modal.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.pill-action-row { display: flex; gap: 10px; }
.pill-action-btn { flex: 1; padding: 10px; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 10px; font-weight: 600; color: #4a0e17; cursor: pointer; transition: 0.2s; font-size: 0.9rem;}
.pill-action-btn.outline { background: transparent; border: 1.5px dashed rgba(212, 175, 55, 0.8); }
.search-box-wrapper input { width: 100%; padding: 12px 15px; background: #fff; border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 10px; outline: none; font-size: 0.95rem; font-family: 'Outfit'; }
#location-results { list-style: none; overflow-y: auto; flex: 1; margin-top: 5px; max-height: 150px;}
.uber-result-item { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; border-bottom: 1px solid rgba(212, 175, 55, 0.15); text-align: left; }
.uber-result-icon { font-size: 1.1rem; background: rgba(217, 37, 37, 0.08); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #d92525; }
.uber-result-text { display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.uber-result-title { font-weight: 600; color: #4a0e17; font-size: 0.95rem; }

.map-picking-overlay { position: fixed; top: 85px; left: 50%; transform: translateX(-50%); background: rgba(217, 37, 37, 0.95); color: white; padding: 12px 24px; border-radius: 30px; z-index: 6000; font-weight: 600; box-shadow: 0 4px 15px rgba(217, 37, 37, 0.4); pointer-events: none; opacity: 0; transition: 0.3s; }
.map-picking-overlay.visible { opacity: 1; }
.whatsapp-btn { background: #25D366; color: white; border: none; padding: 14px; border-radius: 12px; font-weight: 600; cursor: pointer; font-size: 1.05rem; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3); margin-bottom: 10px; }
.copy-btn { background: #fff; color: #4a0e17; border: 2px solid rgba(212, 175, 55, 0.4); padding: 12px; border-radius: 12px; font-weight: 600; cursor: pointer; font-size: 1rem; }

/* LEAFLET PINS & CLUSTERS */
.diya-pin { width: 16px; height: 16px; background: radial-gradient(circle, #ffca28, #d92525); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 8px 3px rgba(217, 37, 37, 0.45); transition: 0.3s; }
.diya-pin.highlight { transform: scale(1.2); box-shadow: 0 0 16px 7px rgba(255, 202, 40, 0.85); }
.cluster-pin { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Outfit'; font-weight: 700; color: #fff; background: radial-gradient(circle at 35% 30%, #ffca28, #d92525 72%); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(74,14,23,0.35); }
.cluster-pin.tier-small { width: 30px; height: 30px; font-size: 0.78rem; }
.cluster-pin.tier-medium { width: 40px; height: 40px; font-size: 0.95rem; }
.cluster-pin.tier-large { width: 52px; height: 52px; font-size: 1.15rem; }
.user-marker-wrapper { position: relative; width: 18px; height: 18px; }
.user-dot { position: absolute; width: 18px; height: 18px; background: #3b82f6; border-radius: 50%; border: 3px solid #fff; z-index: 2; box-shadow: 0 0 10px rgba(59,130,246,0.5); }
.user-ring { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: rgba(59,130,246,0.55); z-index: 1; animation: ring-pulse 2s infinite; }
@keyframes ring-pulse { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(2.6); opacity: 0; } }

.leaflet-popup-content-wrapper { background: rgba(253, 251, 247, 0.9) !important; backdrop-filter: blur(10px) !important; border: 1px solid rgba(212, 175, 55, 0.4) !important; color: #4a0e17 !important; border-radius: 12px !important; }
.leaflet-popup-tip-container { display: none !important; }
.popup-content h4 { font-family: 'Fraunces', serif; color: #d92525; margin-bottom: 8px; font-size: 1.1rem; }
.popup-btn { background: transparent; border: 1.5px solid #d92525; color: #d92525; text-decoration: none; padding: 6px 14px; border-radius: 12px; font-size: 0.8rem; display: inline-block; font-weight: 600; }

#splash-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: #000; z-index: 9999; display: flex; align-items: center; justify-content: center; transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out; }
#splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#splash-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.splash-content { animation: splash-float 3s ease-in-out infinite alternate; z-index: 2; pointer-events: none; }
.splash-title { font-family: 'Fraunces', serif; font-size: 2.8rem; color: #d4af37; text-shadow: 0 4px 15px rgba(0,0,0,0.8); margin-bottom: 10px; opacity: 0; animation: fade-in-up 1s forwards 0.2s; }
.splash-subtitle { font-size: 0.95rem; color: #ffca28; letter-spacing: 3px; text-transform: uppercase; opacity: 0; animation: fade-in-up 1s forwards 0.5s; font-weight: 600; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-float { from { transform: translateY(-5px); } to { transform: translateY(5px); } }

/* ==========================================
   ROUTE ITINERARY POLISH
========================================== */
#itinerary-panel { padding-top: 25px; padding-left: 15px; padding-right: 15px; }
.step-travel { margin: 0 0 4px 18px; font-size: 0.8rem; color: #4a0e17; display: flex; flex-direction: column; align-items: flex-start; border-left: 2px dashed rgba(212, 175, 55, 0.8); padding-left: 14px; padding-top: 4px; padding-bottom: 4px; font-weight: 600; gap: 4px; }
.itinerary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid rgba(212, 175, 55, 0.3); }
.itinerary-actions button, #download-pass-btn { padding: 10px 12px !important; border-radius: 8px !important; font-size: 0.85rem !important; }
.itinerary-actions .reset-btn { flex: 1; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(212, 175, 55, 0.6); color: #4a0e17; font-weight: 700; cursor: pointer; transition: 0.2s; }
.itinerary-actions .reset-btn:hover { background: #fff; border-color: #d92525; }
.itinerary-actions .share-btn { flex: 1; background: #25D366; color: white; border: none; font-weight: 700; cursor: pointer; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); transition: 0.2s; }
.itinerary-actions .share-btn:hover { background: #1ebd5a; }
#download-pass-btn { flex: 100%; background: #4a0e17; color: white; border: none; font-weight: 700; cursor: pointer; box-shadow: 0 4px 10px rgba(74, 14, 23, 0.3); transition: 0.3s; margin-top: 0; }
#sidebar:has(#itinerary-panel:not([style*="none"])) #filter-chip-container,
#sidebar:has(#itinerary-panel:not([style*="none"])) #search-container,
.explore-panel:has(#itinerary-panel:not([style*="none"])) #filter-chip-container,
.explore-panel:has(#itinerary-panel:not([style*="none"])) .search-container { display: none !important; }

/* ==========================================
   ACTIVE HUBBA GROUP CARDS
========================================== */
.hubba-group-card { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(212, 175, 55, 0.6); padding: 10px 14px; border-radius: 16px; box-shadow: 0 4px 15px rgba(74, 14, 23, 0.1); transition: transform 0.2s, background 0.2s; }
.hubba-group-card:hover { background: rgba(255, 255, 255, 0.6); transform: translateY(-2px); }
.hubba-info { display: flex; flex-direction: column; gap: 4px; }
.hubba-name { font-family: 'Fraunces', serif; font-weight: 700; color: #d92525; font-size: 1rem; }
.hubba-members { font-size: 0.75rem; color: #4a0e17; font-weight: 600; opacity: 0.8; }
.open-hubba-btn { background: linear-gradient(135deg, #d4af37, #d92525); color: white; border: none; padding: 8px 14px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 0.85rem; box-shadow: 0 4px 10px rgba(217, 37, 37, 0.3); transition: 0.2s; }
.open-hubba-btn:hover { transform: scale(1.05); }

.hubba-card-actions { display: flex; align-items: center; gap: 6px; }
.hubba-icon-btn { background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(212, 175, 55, 0.4); color: #d92525; width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.hubba-icon-btn:hover { background: #fff; border-color: #d92525; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(217, 37, 37, 0.15); }
.hubba-icon-btn.delete:hover { background: #fff3f3; border-color: #ff4d4d; }

#active-hubbas-section { display: none; }
@media (min-width: 769px) {
  #active-hubbas-section { display: flex; flex-direction: column; position: absolute; top: 95px; right: 15px; width: 320px; z-index: 4000; background: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(235, 80, 50, 0.15)); backdrop-filter: blur(32px) saturate(200%); -webkit-backdrop-filter: blur(32px) saturate(200%); border: 1px solid rgba(255, 210, 190, 0.8); box-shadow: 0 16px 40px rgba(74, 14, 23, 0.25); border-radius: 36px; padding: 20px; transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); overflow: hidden; }
  #active-hubbas-section:not(.hubba-collapsed) { max-height: calc(100dvh - 120px); }
  #active-hubbas-section.hubba-collapsed { max-height: 64px; }
  #active-hubbas-section.hubba-collapsed #hubba-toggle-icon { transform: rotate(-180deg); }
  #my-groups-container { transition: opacity 0.2s ease; overflow-y: auto; }
  #active-hubbas-section.hubba-collapsed #my-groups-container { opacity: 0; pointer-events: none; }
  #my-groups-container::-webkit-scrollbar { width: 6px; }
  #my-groups-container::-webkit-scrollbar-track { background: transparent; }
  #my-groups-container::-webkit-scrollbar-thumb { background: rgba(217, 37, 37, 0.3); border-radius: 10px; }
}

/* ==========================================
   METRO MODE
========================================== */
.metro-toggle-pill { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 20px; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.metro-icon { font-size: 1.1rem; }
.metro-text { font-weight: 700; color: #7a1b26; font-size: 0.85rem; display: none; }
.toggle-switch { width: 32px; height: 18px; background: rgba(74, 14, 23, 0.2); border-radius: 20px; position: relative; transition: background 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.toggle-knob { width: 14px; height: 14px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.metro-toggle-pill.active { background: rgba(255, 255, 255, 0.9); border-color: #0ea5e9; box-shadow: 0 0 12px rgba(14, 165, 233, 0.25); }
.metro-toggle-pill.active .toggle-switch { background: #0ea5e9; }
.metro-toggle-pill.active .toggle-knob { transform: translateX(14px); }
@media (min-width: 400px) { .metro-text { display: block; } }

.glass-legend { position: absolute; bottom: 85px; left: 15px; background: rgba(253, 251, 247, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 16px; padding: 15px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 1000; transition: opacity 0.3s ease; }
@media (min-width: 769px) { .glass-legend { left: auto; right: 20px; bottom: 95px; width: auto; } }
.metro-line-filters { display: flex; flex-direction: column; gap: 6px; }
.metro-line-btn { background: rgba(255,255,255,0.6); border: 1px solid transparent; padding: 6px 12px; border-radius: 8px; font-family: inherit; font-weight: 600; color: #4a0e17; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.85rem; transition: 0.2s; }
.metro-line-btn:hover { background: #fff; border-color: rgba(212, 175, 55, 0.5); transform: translateX(4px); }
.line-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.metro-station-node { background: #fff; border: 3px solid #4a0e17; border-radius: 50%; box-shadow: 0 0 10px rgba(255, 255, 255, 0.9); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.metro-station-node:hover { transform: scale(1.4); box-shadow: 0 0 15px #fff; }
.metro-intel-popup .leaflet-popup-content-wrapper { background: rgba(255, 255, 255, 0.95) !important; border: 1px solid #d4af37 !important; border-radius: 16px !important; box-shadow: 0 10px 30px rgba(74, 14, 23, 0.2) !important; }
.metro-halo-radar { animation: radar-pulse 2s infinite alternate ease-in-out; pointer-events: none; }
@keyframes radar-pulse { from { fill-opacity: 0.1; } to { fill-opacity: 0.25; } }

.metro-search-wrapper { position: relative; margin-bottom: 12px; }
#metro-search-box { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(212,175,55,0.6); background: rgba(255,255,255,0.95); color: #4a0e17; font-size: 0.95rem; outline: none; font-family: inherit; font-weight: 600; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s; }
#metro-search-box:focus { border-color: #d92525; box-shadow: 0 0 0 3px rgba(217,37,37,0.1); }
#metro-search-results { position: absolute; top: 100%; left: 0; width: 100%; background: #fffcf9; border-radius: 12px; border: 1px solid rgba(212,175,55,0.4); list-style: none; padding: 5px; margin-top: 4px; box-shadow: 0 8px 20px rgba(74,14,23,0.2); max-height: 180px; overflow-y: auto; display: none; z-index: 2000; }
.metro-search-item { padding: 10px 12px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border-radius: 8px; color: #4a0e17; transition: 0.2s; }
.metro-search-item:hover { background: rgba(217,37,37,0.1); color: #d92525; }

/* ==========================================
   MOBILE RESPONSIVENESS & SCALING (< 769px)
========================================== */
@media (max-width: 768px) {
  /* 1. App Header (Stretched Title & Aligned Tools) */
  #app-header {
    top: 10px !important;
    left: 10px !important;
    width: calc(100vw - 20px) !important;
    height: auto !important;
    padding: 0 !important;
    
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    
    display: flex;
    flex-wrap: wrap !important;
    justify-content: space-between !important; 
    align-items: center !important;
    gap: 10px 0 !important; 
    z-index: 5000 !important;
  }

  .header-left { display: flex !important; flex: 0 0 100% !important; }
  #map-title {
    width: 100% !important; 
    background: rgba(253, 251, 247, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    padding: 10px 20px !important;
    border-radius: 30px !important; 
    box-shadow: 0 4px 15px rgba(74, 14, 23, 0.12) !important;
    text-align: center !important;
  }
  #map-title h1 { font-size: 1.25rem !important; line-height: 1 !important; color: #d92525 !important; margin: 0 !important; }
  #count-label { display: none !important; }

  .header-center { flex: 1 !important; justify-content: flex-start !important; gap: 8px !important; }
  .header-right { flex: 0 0 auto !important; justify-content: flex-end !important; }

  .mode-toggle-pill, .metro-toggle-pill, #start-pill-box {
    background: rgba(253, 251, 247, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    box-shadow: 0 4px 12px rgba(74, 14, 23, 0.1) !important;
    height: 38px !important; 
    display: flex !important;
    align-items: center !important;
  }
  
  .mode-toggle-pill { padding: 3px !important; border-radius: 30px !important; }
  .mode-toggle-pill button { padding: 0 12px !important; font-size: 0.78rem !important; font-weight: 700 !important; border-radius: 25px !important; height: 100% !important; }
  
  .metro-toggle-pill { padding: 0 12px !important; border-radius: 30px !important; gap: 8px !important; }
  .metro-icon { font-size: 1.15rem !important; }
  .metro-text { display: none !important; }
  .toggle-switch { width: 34px !important; height: 18px !important; border-radius: 18px !important;}
  .toggle-knob { width: 14px !important; height: 14px !important; top: 2px !important; left: 2px !important; box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;}
  .metro-toggle-pill.active .toggle-knob { transform: translateX(16px) !important; }

  #start-pill-box { padding: 0 16px !important; border-radius: 30px !important; justify-content: center !important; }
  #start-closed-ui { font-size: 1.2rem !important; margin: 0 !important; padding: 0 !important; line-height: 1 !important; display: flex !important; align-items: center !important; }
  #start-pill-text { display: none !important; }

  /* 2. Explore Panel */
  .explore-panel, #sidebar {
    bottom: 80px !important; 
    border-radius: 32px 32px 0 0 !important;
    box-shadow: 0 -6px 25px rgba(74, 14, 23, 0.12) !important;
    background: rgba(253, 251, 247, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    height: 40dvh;
    min-height: 12dvh;
    max-height: calc(100dvh - 80px - 70px) !important;
    overflow: hidden !important; 
  }
  .toran-border {
    top: 0 !important;
    height: 16px !important;
    border-radius: 0 !important; 
    background: radial-gradient(circle at 10px 0, #d4af37 8px, transparent 9px) !important;
    background-size: 20px 16px !important;
    background-repeat: repeat-x !important;
  }
  #drag-area { padding: 18px 0 8px !important; }
  .drag-handle { width: 40px !important; height: 5px !important; border-radius: 3px !important; background: rgba(122, 27, 38, 0.28) !important; }
  .search-container { padding: 0 12px 6px !important; margin: 0 !important; }
  #search-box { padding: 7px 12px !important; font-size: 0.82rem !important; border-radius: 10px !important; }
  .panel-filters { padding: 0 12px 6px !important; gap: 5px !important; }
  .filter-chip { padding: 4px 10px !important; font-size: 0.74rem !important; font-weight: 600 !important; border-radius: 14px !important; }
  
  /* Creates space for the absolute action bar so it doesn't cover the last pandal */
  .panel-content { padding: 0 12px 75px !important; }
  
  .pandal-card { padding: 7px 10px !important; margin-bottom: 5px !important; border-radius: 10px !important; }
  .pandal-info h3 { font-size: 0.82rem !important; font-weight: 600 !important; }
  .add-btn { padding: 4px 10px !important; font-size: 0.74rem !important; font-weight: 600 !important; border-radius: 6px !important; }

  /* Proposal Action Bar on Mobile - Perfectly Floating Pill */
  #proposal-action-bar {
    padding: 0 12px 16px !important;
    gap: 8px !important;
    border: none !important;
    background: transparent !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
  }
  #cancel-proposal-btn { padding: 10px 12px !important; font-size: 0.85rem !important; border-radius: 30px !important; }
  #generate-route-btn { padding: 12px 14px !important; font-size: 0.95rem !important; border-radius: 30px !important; }

  /* 3. Bottom Nav Bar */
  #bottom-nav { height: 60px !important; bottom: 10px !important; width: calc(100vw - 20px) !important; padding: 6px !important; }
  .nav-tab { width: auto !important; gap: 2px !important; }
  .nav-tab .tab-icon { font-size: 1.15rem !important; }
  .nav-tab .tab-label { font-size: 0.6rem !important; font-weight: 700 !important; }

  /* 4. Mobile Groups Page */
  #mobile-groups-page { position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100dvh !important; background: #fdfbf7 !important; z-index: 4500 !important; overflow-y: auto !important; padding-bottom: 90px !important; }
  .groups-page-header { padding: 20px 16px 12px !important; background: rgba(255,255,255,0.85) !important; border-bottom: 1px solid rgba(212, 175, 55, 0.3) !important; }
  .groups-page-header h2 { font-size: 1.3rem !important; font-family: 'Fraunces', serif !important; color: #d92525 !important; margin: 0 !important; }
  .groups-page-header p { font-size: 0.78rem !important; color: #7a1b26 !important; margin-top: 2px !important; }
  .create-room-main-btn { width: 100% !important; background: linear-gradient(135deg, #d4af37, #d92525) !important; color: #fff !important; border: none !important; padding: 11px 14px !important; border-radius: 12px !important; font-weight: 700 !important; font-size: 0.88rem !important; margin-bottom: 16px !important; box-shadow: 0 4px 15px rgba(217, 37, 37, 0.25) !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; font-family: inherit !important; cursor: pointer !important; }
  .groups-section-title { font-family: 'Fraunces', serif !important; font-size: 0.92rem !important; color: #4a0e17 !important; margin-bottom: 10px !important; }

  /* 5. Hubba Bottom Sheet Container */
  .hubba-sheet-container { left: 0 !important; width: 100% !important; height: 82dvh !important; border-radius: 20px 20px 0 0 !important; border-top: 2px solid #d4af37 !important; bottom: -120%; }
  .hubba-sheet-container.open { bottom: 0 !important; }
  .hubba-drag-handle-wrapper { width: 100% !important; padding: 8px 0 2px !important; display: flex !important; justify-content: center !important; }
  .desktop-only-btn { display: none !important; }

  /* 6. Hubba Sheet Header & Tabs */
  .hubba-sheet-header { padding: 4px 14px 8px !important; }
  #dashboard-group-name { font-size: 1.05rem !important; font-weight: 700 !important; margin: 0 0 2px !important; }
  .hubba-code-badge { font-size: 0.65rem !important; padding: 2px 8px !important; border-radius: 8px !important; font-weight: 700 !important; }
  .hubba-close-btn { top: 4px !important; right: 10px !important; width: 24px !important; height: 24px !important; font-size: 0.75rem !important; }
  .hubba-tab-container { margin: 5px auto 0 !important; padding: 2px !important; max-width: 250px !important; border-radius: 25px !important; }
  .hubba-tab-btn { padding: 5px 8px !important; font-size: 0.76rem !important; font-weight: 700 !important; }
  .tab-slider { top: 2px !important; bottom: 2px !important; left: 2px !important; width: calc(50% - 2px) !important; border-radius: 25px !important; }

  /* 7. Precision Pill */
  #hubba-pill-container.pill-state-center { top: 20% !important; }
  #hubba-pill-container.pill-state-top { top: 6px !important; transform: translateX(-50%) scale(0.82) !important; }
  #hubba-dynamic-pill { padding: 6px 12px !important; gap: 6px !important; border-radius: 25px !important; box-shadow: 0 4px 15px rgba(217, 37, 37, 0.12) !important; }
  #dynamic-pill-title { font-size: 0.78rem !important; font-weight: 700 !important; }
  .pill-subtext { font-size: 0.6rem !important; }
  .pill-arrow { font-size: 0.82rem !important; }
  .pill-glow-dot { width: 6px !important; height: 6px !important; }

  /* 8. Chat Workspace, Messages & Poll Cards */
  #hubba-workspace-chat { overflow: hidden; }
  .chat-messages-container { padding: 48px 10px 8px !important; gap: 8px !important; }
  .chat-msg-wrapper { max-width: 88% !important; }
  
  .chat-bubble { padding: 8px 11px !important; font-size: 0.82rem !important; line-height: 1.35 !important; border-radius: 14px !important; -webkit-transform: translate3d(0,0,0) !important; transform: translate3d(0,0,0) !important; }
  
  .sent .chat-bubble, .chat-bubble.outgoing { border-radius: 14px 14px 4px 14px !important; }
  .received .chat-bubble, .chat-bubble.incoming { border-radius: 14px 14px 14px 4px !important; background: #ffffff !important; }
  .chat-sender { font-size: 0.65rem !important; margin-bottom: 2px !important; font-weight: 700 !important; }
  .chat-time { font-size: 0.56rem !important; margin-top: 2px !important; }
  
  /* Proposal Bubble on Mobile */
  .chat-bubble.proposal { padding: 10px 11px !important; width: 96% !important; max-width: 320px !important; border-radius: 12px !important; }
  .multi-proposal-container { gap: 5px !important; margin-top: 6px !important; }
  .multi-proposal-item { padding: 7px 9px !important; border-radius: 8px !important; }
  .proposal-title { font-size: 0.78rem !important; font-weight: 700 !important; margin-bottom: 5px !important; }
  .vote-panel-mini { gap: 6px !important; }
  .vote-btn-mini { padding: 4px 8px !important; font-size: 0.7rem !important; font-weight: 700 !important; border-radius: 6px !important; gap: 4px !important; }

  /* 9. Chat Input Row */
  .chat-input-row { margin: 5px 8px 7px !important; padding: 2px 2px 2px 10px !important; border-radius: 30px !important; gap: 4px !important; }
  .chat-input-row input { padding: 5px 2px !important; font-size: 0.82rem !important; }
  .chat-input-row button { width: 32px !important; height: 32px !important; font-size: 0.9rem !important; }

  /* 10. Plan Workspace */
  #hubba-workspace-plan { padding: 10px 12px !important; }
  #plan-start-btn { padding: 10px 12px !important; font-size: 0.82rem !important; border-radius: 10px !important; margin-bottom: 8px !important; gap: 6px !important; }
  #hubba-workspace-plan h3 { font-size: 0.88rem !important; margin: 0 0 6px !important; }
  #plan-final-list { gap: 5px !important; margin-bottom: 10px !important; }
  #plan-final-list > div { padding: 7px 10px !important; font-size: 0.8rem !important; border-radius: 8px !important; }
  #plan-final-list > div button { width: 22px !important; height: 22px !important; font-size: 0.7rem !important; }
  .draw-route-btn { padding: 10px !important; font-size: 0.88rem !important; border-radius: 10px !important; }

  /* 11. Proposal Guidance Tooltip */
  #proposal-guidance-tooltip { font-size: 0.82rem !important; padding: 7px 14px !important; top: 10% !important; border-radius: 20px !important; }

  /* 12. Modals on Mobile */
  .center-modal { width: 88% !important; max-width: 320px !important; padding: 18px 16px !important; border-radius: 16px !important; }
  .center-modal h2, .center-modal h3 { font-size: 1.15rem !important; margin-bottom: 4px !important; }
  .center-modal p { font-size: 0.8rem !important; margin-bottom: 12px !important; }
  .whatsapp-btn { padding: 10px !important; font-size: 0.88rem !important; border-radius: 10px !important; }
  .copy-btn { padding: 9px !important; font-size: 0.85rem !important; border-radius: 10px !important; }
  .pill-action-btn { padding: 8px !important; font-size: 0.82rem !important; }
}

/* ==========================================
   FESTIVE HUBBA CHAT UI (PC & MOBILE CORE)
========================================== */
.hubba-sheet-container {
  position: fixed;
  background: #fffbf0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: bottom 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s;
  box-shadow: 0 -10px 40px rgba(74, 14, 23, 0.2);
  overflow: hidden;
}

@media (min-width: 769px) {
  .hubba-sheet-container {
    width: 400px; height: 90vh; max-height: 1200px;
    left: auto; right: 25px; 
    border-radius: 20px; border: 2px solid #d4af37; 
    box-shadow: 0 15px 50px rgba(74, 14, 23, 0.15);
    bottom: -150%; 
  }
  .hubba-sheet-container.open { bottom: 25px; }
  .hubba-drag-handle-wrapper { display: none; }
  .desktop-only-btn { display: flex; position: absolute; top: 15px; left: 20px; background: rgba(212, 175, 55, 0.15); color: #b48512; border: 1px solid rgba(212, 175, 55, 0.4); padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; cursor: pointer; align-items: center; gap: 6px; transition: all 0.2s; font-family: inherit; }
  .desktop-only-btn:hover { background: #d4af37; color: #fff; }
}

.hubba-sheet-header { text-align: center; position: relative; padding: 10px 20px 15px; border-bottom: 1px solid rgba(212, 175, 55, 0.3); flex-shrink: 0; }
.hubba-close-btn { position: absolute; top: 10px; right: 20px; background: rgba(217,37,37,0.1); color: #d92525; border: none; width: 32px; height: 32px; border-radius: 50%; font-weight: bold; cursor: pointer; transition: 0.2s; }
.hubba-close-btn:hover { background: #d92525; color: white; }
#dashboard-group-name { font-family: 'Fraunces', serif; color: #7a1b26; margin: 0 0 6px; font-size: 1.4rem; }
.hubba-code-badge { font-size: 0.75rem; background: rgba(212, 175, 55, 0.15); color: #b48512; padding: 4px 12px; border-radius: 12px; font-weight: bold; }

.hubba-workspace { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; background: #fdfbf7; }

/* Dedicated Dead-Center Alpana Watermark for Chat */
#hubba-workspace-chat {
  position: relative;
  background: #fdfbf7;
  overflow: hidden;
}

#hubba-workspace-chat::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92%);
  height: min(560px, 88%);
  background-image: url("alpana_watermark.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================
   CHAT WORKSPACE & BUBBLES (PREMIUM UI)
========================================== */
.chat-messages-container { flex-grow: 1; padding: 64px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; z-index: 1; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; overflow-anchor: none; }

.chat-msg-wrapper { display: flex; flex-direction: column; max-width: 85%; }
.chat-msg-wrapper.sent { align-self: flex-end; align-items: flex-end; }
.chat-msg-wrapper.received { align-self: flex-start; align-items: flex-start; }

.chat-sender { display: block; font-size: 0.75rem; font-weight: 700; margin-bottom: 4px; color: #b48512; letter-spacing: 0.3px; }
.chat-sender-name { font-size: 0.75rem; color: #7a1b26; margin-bottom: 6px; font-weight: 700; padding: 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Base Chat Bubble */
.chat-bubble { padding: 12px 16px; font-size: 0.95rem; line-height: 1.45; word-wrap: break-word; font-family: inherit; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.04); -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* Modern Sent & Received Styling */
.sent .chat-bubble, .chat-bubble.outgoing { background: linear-gradient(135deg, #d92525, #b81d24); color: white; border-radius: 20px 20px 4px 20px; box-shadow: 0 4px 14px rgba(217, 37, 37, 0.2); align-self: flex-end; }
.sent .chat-bubble .chat-sender, .chat-bubble.outgoing .chat-sender { color: #fef08a; }
.sent .chat-bubble .chat-time, .chat-bubble.outgoing .chat-time { color: rgba(255, 255, 255, 0.75); }

.received .chat-bubble, .chat-bubble.incoming { background: #ffffff; color: #4a0e17; border-radius: 20px 20px 20px 4px; border: 1px solid rgba(212, 175, 55, 0.3); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); align-self: flex-start; }
.received .chat-bubble .chat-time, .chat-bubble.incoming .chat-time { color: #94a3b8; }

.chat-time { font-size: 0.65rem; margin-top: 6px; display: block; text-align: right; font-weight: 600; }

/* ==========================================
   INTERACTIVE PROPOSAL POLL CARDS
========================================== */
.chat-bubble.proposal { background: #fffcf9 !important; color: #4a0e17 !important; border: 1.5px solid rgba(212, 175, 55, 0.45) !important; border-radius: 16px !important; width: 92%; max-width: 340px; align-self: center !important; box-shadow: 0 6px 20px rgba(122, 27, 38, 0.08) !important; padding: 16px; }

.multi-proposal-container { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.multi-proposal-item { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: all 0.2s ease; }
.multi-proposal-item:hover { border-color: rgba(212, 175, 55, 0.5); box-shadow: 0 4px 10px rgba(212, 175, 55, 0.1); }

.proposal-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; color: #7a1b26; display: flex; align-items: center; gap: 6px; }

/* The Voting Buttons */
.vote-panel-mini { display: flex; gap: 8px; }
.vote-btn-mini { flex: 1; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; font-size: 0.85rem; font-weight: 700; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 6px; transition: all 0.2s ease; color: #64748b; }

/* Upvote Green */
.vote-btn-mini.up { color: #27ae60; }
.vote-btn-mini.up:hover, .vote-btn-mini.up.active { background: #e8f5e9; border-color: #2ecc71; box-shadow: inset 0 2px 4px rgba(46, 204, 113, 0.1); }

/* Downvote Red */
.vote-btn-mini.down { color: #d92525; }
.vote-btn-mini.down:hover, .vote-btn-mini.down.active { background: #fff3f3; border-color: #ff4d4d; box-shadow: inset 0 2px 4px rgba(217, 37, 37, 0.1); }

/* ==========================================
   INPUT COMMAND CENTER
========================================== */
.chat-input-row { margin: 10px 14px 14px; padding: 6px 6px 6px 16px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 40px; display: flex; gap: 8px; align-items: center; flex-shrink: 0; box-shadow: 0 8px 25px rgba(122, 27, 38, 0.1); }
.chat-input-row input { flex-grow: 1; padding: 10px 4px; border: none; background: transparent; font-size: 0.95rem; outline: none; font-family: inherit; color: #4a0e17; font-weight: 500; }
.chat-input-row input::placeholder { color: #94a3b8; }
.chat-input-row button { background: linear-gradient(135deg, #d4af37, #b48512); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem; box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4); flex-shrink: 0; transition: transform 0.2s; }
.chat-input-row button:active { transform: scale(0.9); }

/* ==========================================
   DYNAMIC HUBBA PILL & ROUTES ARCHIVE
========================================== */
#hubba-pill-container { position: absolute; left: 50%; transform: translateX(-50%); z-index: 50; pointer-events: none; }
.pill-state-center { top: 40%; }
.pill-state-top { top: 15px; transform: translateX(-50%) scale(0.85); }
.pill-state-top .pill-subtext { display: none; }
.pill-state-top #hubba-dynamic-pill { padding: 8px 16px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: rgba(253, 251, 247, 0.85); border: 1px solid rgba(212, 175, 55, 0.5); box-shadow: 0 4px 20px rgba(122, 27, 38, 0.12); }

#hubba-dynamic-pill { pointer-events: auto; background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(253, 251, 247, 0.85)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(217, 37, 37, 0.25); padding: 10px 20px; border-radius: 50px; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 20px rgba(217, 37, 37, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5); cursor: pointer; transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); font-family: inherit; }
#hubba-dynamic-pill:hover { box-shadow: 0 6px 25px rgba(217, 37, 37, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6); transform: translateY(-1px); border-color: rgba(217, 37, 37, 0.4); }
.pill-glow-dot { width: 8px; height: 8px; background: #d92525; border-radius: 50%; box-shadow: 0 0 8px rgba(217, 37, 37, 0.6); animation: pulse-glow 2s ease-in-out infinite; }
@keyframes pulse-glow { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.1); } }
.pill-text-content { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
#dynamic-pill-title { color: #d92525; font-size: 0.95rem; font-weight: 700; }
.pill-subtext { font-size: 0.7rem; color: #888; font-weight: 500; }
.pill-arrow { color: #d92525; font-weight: bold; font-size: 1.1rem; margin-left: 3px; }

.route-history-panel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #fffcf9; z-index: 9000; display: flex; flex-direction: column; padding: 15px; box-sizing: border-box; transform: translateY(-100%); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
.route-history-panel.open { transform: translateY(0); }
.search-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-family: 'Fraunces', serif; color: #d92525; font-size: 1.3rem; flex-shrink: 0; }
.search-panel-header button { background: rgba(217,37,37,0.1); color: #d92525; border: none; width: 32px; height: 32px; border-radius: 50%; font-weight: bold; cursor: pointer; transition: 0.2s; }
.history-list { overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; gap: 15px; padding-top: 10px; }
.history-date-group { font-size: 0.75rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; border-bottom: 1px solid #f1f5f9; padding-bottom: 4px; }
.history-card { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #d92525; padding: 14px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.history-card-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; color: #4a0e17; font-weight: 800; }
.history-card-route { font-size: 0.85rem; color: #7a1b26; margin-bottom: 12px; line-height: 1.5; }
.history-card-btn { width: 100%; background: rgba(46, 204, 113, 0.1); color: #27ae60; border: 1px solid rgba(46, 204, 113, 0.3); padding: 10px; border-radius: 10px; font-weight: bold; font-size: 0.9rem; cursor: pointer; transition: 0.2s; font-family: inherit; }

.hubba-tab-container { position: relative; display: flex; width: 100%; max-width: 400px; margin: 15px auto 0; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 50px; padding: 6px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); }
.hubba-tab-btn { flex: 1; padding: 12px; border: none; background: transparent; color: #7a1b26; font-weight: 700; font-size: 0.95rem; cursor: pointer; border-radius: 50px; position: relative; z-index: 2; transition: color 0.3s ease; font-family: inherit; }
.hubba-tab-btn.active { color: #fff; }
.tab-slider { position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc(50% - 6px); background: linear-gradient(135deg, #ff5e4d, #d92525); border-radius: 50px; z-index: 1; box-shadow: 0 4px 12px rgba(217, 37, 37, 0.3); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.tab-slider.chat-active { transform: translateX(0); }
.tab-slider.plan-active { transform: translateX(100%); }

#hubba-workspace-plan { padding: 20px; background: transparent; }
#plan-start-btn { width: 100%; background: rgba(217, 37, 37, 0.03); border: 2px dashed rgba(217, 37, 37, 0.4); color: #d92525; padding: 16px; border-radius: 16px; font-weight: 700; font-size: 1rem; cursor: pointer; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; font-family: inherit; }
#hubba-workspace-plan h3 { font-family: 'Fraunces', serif; font-size: 1.2rem; color: #4a0e17; margin: 0 0 12px 0; }
#plan-final-list { display: flex; flex-direction: column; gap: 12px; flex-grow: 1; overflow-y: auto; margin-bottom: 20px; padding-right: 5px; }
#plan-final-list > div { background: #ffffff; border: 1px solid rgba(212, 175, 55, 0.4); padding: 14px 18px; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(74, 14, 23, 0.04); font-weight: 600; color: #4a0e17; font-size: 0.95rem; }
#plan-final-list > div button { background: rgba(217, 37, 37, 0.08); color: #d92525; border: none; width: 30px; height: 30px; border-radius: 50%; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.draw-route-btn { width: 100%; background: linear-gradient(135deg, #d92525, #b31b1b); color: white; border: none; padding: 18px; border-radius: 16px; font-weight: 700; font-size: 1.1rem; cursor: pointer; box-shadow: 0 6px 20px rgba(217, 37, 37, 0.25); flex-shrink: 0; font-family: inherit; }

/* ==========================================
   CINEMATIC PROPOSAL MODE
========================================== */
.leaflet-tile-pane.map-dimmed { filter: brightness(0.3) contrast(1.1) grayscale(0.4) !important; }

#proposal-guidance-tooltip { position: fixed; top: 20%; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #d4af37, #d92525); color: white; padding: 12px 24px; border-radius: 30px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.1rem; box-shadow: 0 8px 25px rgba(217, 37, 37, 0.4); z-index: 9000; opacity: 0; pointer-events: none; white-space: nowrap; display: none; }
@media (min-width: 769px) { #proposal-guidance-tooltip { left: 420px; top: 120px; transform: none; } }
.tooltip-blink-fade { display: block !important; animation: blinkAndFade 4.5s forwards; }
@keyframes blinkAndFade { 0%, 20%, 40%, 60% { opacity: 1; transform: translateX(-50%) scale(1.05); } 10%, 30%, 50% { opacity: 0.7; transform: translateX(-50%) scale(1); } 80% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(0.9); display: none; } }
@media (min-width: 769px) { @keyframes blinkAndFade { 0%, 20%, 40%, 60% { opacity: 1; transform: scale(1.05); } 10%, 30%, 50% { opacity: 0.7; transform: scale(1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.9); display: none; } } }
/* ==========================================
   METRO MODE UI POLISH (THE ART)
========================================== */
.search-container { position: relative; z-index: 3000; perspective: 1000px; }

/* Smooth Transition for the Input Box */
#search-box { transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }

/* When Metro Mode is active (Class applied via JS) */
.search-container.metro-theme #search-box {
  border: 1.5px solid #0ea5e9 !important;
  background: #f0f9ff !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}
.search-container.metro-theme #search-box::placeholder { color: #38bdf8; opacity: 0.8; }
.search-container.metro-theme #search-box:focus {
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
  background: #ffffff !important;
}

/* Metro Dropdown Results - Premium Glassmorphism */
#metro-search-results {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  box-shadow: 0 16px 40px rgba(2, 132, 199, 0.15), 0 4px 10px rgba(0,0,0,0.05) !important;
  border-radius: 16px !important;
  padding: 8px !important;
  transform-origin: top center;
  animation: dropDownBounce 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards;
}

@keyframes dropDownBounce {
  0% { opacity: 0; transform: scaleY(0.9) translateY(-10px); }
  100% { opacity: 1; transform: scaleY(1) translateY(0); }
}

/* Individual Metro Result Item Hover Engine */
.metro-search-item {
  padding: 12px 16px !important;
  border-radius: 12px;
  margin-bottom: 4px;
  border: 1px solid transparent !important;
  background: transparent;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
}
.metro-search-item:last-child { margin-bottom: 0; }
.metro-search-item:hover {
  background: linear-gradient(135deg, #ffffff, #e0f2fe) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
  transform: translateX(4px); /* Slight bump to the right */
}

/* Metro Line Filter Chips Container - HORIZONTAL SCROLL FIX & NO PARTITION */
#metro-line-filters {
  /* Removed the dashed border-top completely */
  border-top: none !important; 
  
  /* Removed top padding and added a negative margin to pull it flush with the Pujo filters */
  padding: 0 15px 12px 15px !important; 
  margin-top: -4px !important; 
  
  animation: fadeInSlide 0.35s ease-out;
  
  /* Force a scrollable horizontal row */
  flex-direction: row !important; 
  flex-wrap: nowrap !important;   
  overflow-x: auto !important;    
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide the ugly scrollbar but keep the scroll functionality */
#metro-line-filters::-webkit-scrollbar { 
  display: none; 
}

/* Beautiful Floating Chips */
.metro-line-filters .filter-chip {
  background: rgba(255, 255, 255, 0.8) !important;
  border-width: 1.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.metro-line-filters .filter-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  background: #ffffff !important;
}
/* ==========================================
   PANDAL CARDS: PILL DESIGN UPGRADE
========================================== */
/* 1. Make the main card a pill */
.pandal-card { 
  border-radius: 50px !important; 
  padding: 10px 12px 10px 22px !important; /* Extra left padding so text clears the curve */
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.25) !important;
}

/* 2. Make the Add button a matching pill */
.add-btn { 
  border-radius: 50px !important; 
  padding: 8px 16px !important; 
  font-weight: 700 !important;
}

/* 3. Mobile scaling so they fit perfectly on phones */
@media (max-width: 768px) {
  .pandal-card {
    padding: 6px 8px 6px 16px !important;
  }
  .add-btn {
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
  }
}
/* ==========================================
   HUBBA GROUP CARDS: PILL DESIGN UPGRADE
========================================== */
/* 1. The Floating Group Card */
.hubba-group-card {
  border-radius: 50px !important;
  padding: 10px 12px 10px 22px !important; 
}

/* 2. The 'Open' Button & Icon Buttons */
.open-hubba-btn {
  border-radius: 50px !important;
  padding: 8px 18px !important;
}
.hubba-icon-btn {
  border-radius: 50% !important; /* Makes the square icons perfect circles */
}

/* 3. The Saved Rooms inside the Groups Tab (Mobile & Desktop) */
#my-groups-container > div,
#mobile-groups-list > div {
  border-radius: 40px !important; /* Main container pill */
}

/* Smooths out the inside buttons so they don't poke outside the pill curve */
#my-groups-container > div > div:first-child > button:first-child,
#mobile-groups-list > div > div:first-child > button:first-child {
  border-radius: 40px 0 0 40px !important; 
  padding-left: 22px !important;
}
#my-groups-container > div > div:first-child > button:last-child,
#mobile-groups-list > div > div:first-child > button:last-child {
  border-radius: 0 40px 40px 0 !important;
  padding-right: 15px !important;
}

/* Smooths out the inside buttons so they don't poke outside the pill curve */
#my-groups-container > div > div:first-child > button:first-child {
  border-radius: 40px 0 0 40px !important; 
  padding-left: 22px !important;
}
#my-groups-container > div > div:first-child > button:last-child {
  border-radius: 0 40px 40px 0 !important;
  padding-right: 15px !important;
}
/* ==========================================
   HUBBA GROUP CARDS & EXPANDED STATE (COMPACT)
========================================== */
.hubba-group-card { border-radius: 50px !important; padding: 10px 12px 10px 22px !important; }
.open-hubba-btn { border-radius: 50px !important; padding: 8px 18px !important; }
.hubba-icon-btn { border-radius: 50% !important; }

#my-groups-container > div, #mobile-groups-list > div { border-radius: 40px !important; }
#my-groups-container > div > div:first-child > button:first-child,
#mobile-groups-list > div > div:first-child > button:first-child { border-radius: 40px 0 0 40px !important; padding-left: 22px !important; }
#my-groups-container > div > div:first-child > button:last-child,
#mobile-groups-list > div > div:first-child > button:last-child { border-radius: 0 40px 40px 0 !important; padding-right: 15px !important; }

div[id^="room-dropdown-"], div[id^="actions-"] { border-top: 1.5px dashed rgba(212, 175, 55, 0.3) !important; background: transparent !important; padding: 14px 18px 18px !important; }
div[id^="room-dropdown-"] > button { border-radius: 50px !important; padding: 12px 22px !important; background: linear-gradient(135deg, #ffffff, #fffdf8) !important; border: 1.5px solid rgba(212, 175, 55, 0.4) !important; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1) !important; transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) !important; }
div[id^="room-dropdown-"] > button:hover { box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25) !important; border-color: #d4af37 !important; transform: translateY(-2px); }
div[id^="room-dropdown-"] > button > span:last-child { border-radius: 30px !important; padding: 4px 12px !important; font-weight: 800 !important; }
.group-action-btn { border-radius: 50px !important; padding: 10px 16px !important; font-weight: 700 !important; border: none !important; box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important; }

/* ==========================================
   SOS PAGE
========================================== */
#mobile-sos-page {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100dvh;
  background: #fdfbf7;
  z-index: 4500;
  overflow-y: auto;
  padding-bottom: 90px;
}

.sos-page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 60px 24px 40px;
  min-height: calc(100dvh - 200px);
}

/* --- SOS Pills --- */
.sos-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 340px;
  padding: 22px 24px;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.sos-pill:active { transform: scale(0.97); }

.sos-pill-icon { font-size: 1.6rem; flex-shrink: 0; }
.sos-pill-label { flex: 1; text-align: left; letter-spacing: 0.5px; }
.sos-pill-sub {
  position: absolute;
  bottom: 10px;
  left: 62px;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 0.3px;
}
.sos-pill-arrow {
  font-size: 1.2rem;
  opacity: 0.7;
  transition: transform 0.2s;
}
.sos-pill:hover .sos-pill-arrow { transform: translateX(3px); }

/* Green Pill — Pharmacy */
.sos-pill-green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 0 25px rgba(22, 163, 74, 0.35), 0 6px 20px rgba(22, 163, 74, 0.2);
}
.sos-pill-green .sos-pill-glow {
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 30px rgba(255,255,255,0.1);
  animation: sos-glow-green 2s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes sos-glow-green {
  0% { box-shadow: 0 0 20px rgba(22, 163, 74, 0.3), inset 0 0 15px rgba(255,255,255,0.05); }
  100% { box-shadow: 0 0 40px rgba(22, 163, 74, 0.55), inset 0 0 25px rgba(255,255,255,0.12); }
}

/* Red Pill — Dial 100 */
.sos-pill-red {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 0 25px rgba(220, 38, 38, 0.35), 0 6px 20px rgba(220, 38, 38, 0.2);
  padding-bottom: 30px;
}
.sos-pill-red .sos-pill-glow {
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 30px rgba(255,255,255,0.1);
  animation: sos-glow-red 1.5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes sos-glow-red {
  0% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.3), inset 0 0 15px rgba(255,255,255,0.05); }
  100% { box-shadow: 0 0 45px rgba(220, 38, 38, 0.6), inset 0 0 25px rgba(255,255,255,0.12); }
}

/* --- Dial 100 Countdown Overlay --- */
.sos-dial-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.sos-dial-overlay.active { display: flex; }

.sos-dial-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
  animation: sos-card-in 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes sos-card-in {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.sos-dial-ring {
  position: relative;
  width: 120px; height: 120px;
}
.sos-dial-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.sos-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}
.sos-ring-fill {
  fill: none;
  stroke: #ef4444;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.sos-countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
}

.sos-dial-text {
  color: rgba(255,255,255,0.8);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  text-align: center;
}
.sos-dial-text strong { color: #ef4444; font-size: 1.3rem; }

.sos-cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 14px 40px;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.sos-cancel-btn:active { background: rgba(255, 255, 255, 0.2); transform: scale(0.96); }
/* ==========================================
   TRUE E-COMMERCE STAR RATING SYSTEM
========================================== */
.pandal-rating-box { display: flex; justify-content: center; gap: 6px; margin-top: 5px; }
.vote-star { 
    background: none; 
    border: none; 
    font-size: 2.2rem; 
    color: #cbd5e1; /* Default Unrated Gray */
    cursor: pointer; 
    padding: 0; 
    transition: color 0.1s, transform 0.1s; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    outline: none; 
    -webkit-tap-highlight-color: transparent; 
}

/* Gold color applied via dynamic classes */
.vote-star.hover-gold,
.vote-star.rated { 
    color: #f1c40f !important; 
}

.vote-star:active { transform: scale(0.85); }
/* ==========================================
   LIVE INTEL UI
========================================== */
.intel-display-box {
    background: #fff5f5;
    border: 1px solid #ff4d4d;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.8rem;
    text-align: left;
    margin-top: 12px;
    margin-bottom: 12px;
    line-height: 1.4;
    box-shadow: inset 0 2px 4px rgba(217, 37, 37, 0.05);
}
.intel-report-btn {
    background: #fff3f3 !important;
    border-color: #ff4d4d !important;
    color: #d92525 !important;
}
/* ==========================================
   1. AUTO-PEEK BOTTOM SHEET (FREES UP MAP VIEW)
   ========================================== */
#sidebar {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* When a Pandal Card is open on the map, tuck the bottom sheet down */
#sidebar.sheet-peek {
  transform: translate3d(0, calc(100% - 135px), 0) !important;
}

/* ==========================================
   2. COMPACT PANDAL POPUP CARD (SAVES ~85PX HEIGHT)
   ========================================== */
.leaflet-popup-content-wrapper {
  padding: 2px !important;
  border-radius: 18px !important;
}

.leaflet-popup-content {
  margin: 10px 14px !important;
  line-height: 1.25 !important;
}

/* Tighten title & rating spacing inside the popup */
.leaflet-popup-content h3,
.leaflet-popup-content h4 {
  font-size: 1.05rem !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.2 !important;
}

/* Compact the Rate This Pandal star box */
.pandal-rating-box {
  margin-top: 2px !important;
  padding: 2px 0 !important;
}

.vote-star {
  font-size: 1.45rem !important;
  padding: 2px 5px !important;
  transition: transform 0.15s ease, color 0.15s ease;
}

.vote-star.rated,
.vote-star.hover-gold {
  color: #f59e0b !important;
  transform: scale(1.15);
}
/* Smooth out sidebar height transitions on the GPU */
#sidebar {
  will-change: height, transform;
  transform: translateZ(0);
  transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Slim down the Pandal Card so the map stays visible around it */
.leaflet-popup-content-wrapper {
  padding: 2px !important;
  border-radius: 18px !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  line-height: 1.2 !important;
}

.pandal-popup-container h3 {
  font-size: 1.05rem !important;
  margin: 0 0 4px 0 !important;
}

.pandal-rating-box {
  margin-top: 2px !important;
  padding: 0 !important;
}

.vote-star {
  font-size: 1.4rem !important;
  padding: 2px 4px !important;
}
/* Fatten the touch target of the drag handle so it is effortless to grab */
#drag-area {
  padding: 25px 0 !important;
  margin-top: -15px !important;
  touch-action: none !important;
  cursor: grab;
}
/* ==========================================
   START LOCATION: WATERDROP & SPACING FIX
   ========================================== */

/* 1. Base Hidden State (Tucked into the top right pin) */
#start-expanded-ui {
    display: block !important; /* Overrides old JS inline styles */
    position: absolute;
    top: calc(100% + 12px); 
    right: 5px; /* Aligns with the top right of your header */
    width: 320px;
    max-width: 90vw;
    background: #fdfbf7;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 12px 35px rgba(74, 14, 23, 0.15);
    border-radius: 20px;
    padding: 16px;
    z-index: 4000;
    
    /* The Waterdrop Physics Setup */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.3) translateY(-40px);
    transform-origin: top right; /* Forces the animation to drop out of the pin */
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 2. Active Open State (Springs open) */
#start-expanded-ui.waterdrop-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* 3. Fix the Cramped Spacing */
#start-expanded-ui .pill-action-row {
    margin-bottom: 16px !important; /* Adds breathing room above the search bar */
    display: flex;
    gap: 10px; /* Evenly spaces the two buttons */
    justify-content: space-between;
}

#custom-start-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}
/* Ensure the 3-way tabs format cleanly */
#mobile-routes-page .hubba-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  font-size: 0.8rem !important;
  font-weight: 700;
  z-index: 2;
  color: #888;
  transition: color 0.3s ease;
}

#mobile-routes-page .hubba-tab-btn.active {
  color: #d92525;
}
@keyframes missingStartBlink {
  0%, 100% { background-color: transparent; border-color: #d92525; transform: scale(1); }
  50% { background-color: rgba(217, 37, 37, 0.15); border-color: #ff0000; transform: scale(1.02); box-shadow: 0 0 15px rgba(217,37,37,0.4); }
}
.blink-warning-active {
  animation: missingStartBlink 0.4s ease-in-out 3;
}