/* =========================================
   TALARIA - PREMIUM VIBRANT UI
   Theme: Sunset Glass v6.5 (Modular)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* Modules */
/* Modules are now loaded in index.html for better cache control */


/* UI Overlay Wrapper */
.app-ui {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   pointer-events: none;
   /* Let clicks pass through to map */
   z-index: 1000;
}

/* Sidebar Styles */
.sidebar {
   pointer-events: auto;
   position: fixed;
   top: 110px;
   left: 20px;
   width: 320px;
   height: calc(100vh - 130px);
   background: rgba(255, 255, 255, 0.95);
   backdrop-filter: blur(20px) saturate(180%);
   -webkit-backdrop-filter: blur(20px) saturate(180%);
   border: 1px solid rgba(78, 32, 61, 0.08);
   border-radius: 24px;
   padding: 24px 20px;
   box-shadow: 0 8px 32px rgba(78, 32, 61, 0.08);
   z-index: 1000;
   transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
   display: flex;
   flex-direction: column;
   gap: 12px;
   font-family: 'Outfit', sans-serif;
   overflow-y: auto;
   overflow-x: hidden;
   scrollbar-width: thin;
   scrollbar-color: #cbd5e1 transparent;
}

/* Collapsed state */
.sidebar.collapsed {
   transform: translateX(calc(-100% - 20px));
   box-shadow: none;
}

/* Toggle button */
.sidebar-toggle {
   position: fixed;
   top: 130px;
   left: 330px;
   width: 32px;
   height: 48px;
   background: rgba(255, 255, 255, 0.95);
   border: 1px solid rgba(78, 32, 61, 0.08);
   border-left: none;
   border-radius: 0 12px 12px 0;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 1001;
   box-shadow: 4px 0 12px rgba(78, 32, 61, 0.05);
   transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
   pointer-events: auto;
   color: #666;
   font-size: 0.8rem;
   padding: 0;
}

.sidebar-toggle:hover {
   background: #fdfdfd;
   color: var(--primary);
}

.sidebar.collapsed~.sidebar-toggle {
   left: 0;
   border: 1px solid rgba(78, 32, 61, 0.08);
   border-left: none;
   border-radius: 0 12px 12px 0;
}

.sidebar::-webkit-scrollbar {
   width: 4px;
}

.sidebar::-webkit-scrollbar-track {
   background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
   background-color: #cbd5e1;
   border-radius: 4px;
}

.sidebar h2 {
   font-size: 1rem;
   /* Reduced font size */
   font-weight: 700;
   margin-bottom: 2px;
   color: var(--secondary);
}

.sidebar-input-group {
   display: flex;
   flex-direction: column;
   gap: 2px;
}

.sidebar-input-group label {
   font-size: 0.75rem;
   /* Reduced font size */
   font-weight: 600;
   color: var(--text-muted);
}

.sidebar-input {
   padding: 6px 10px;
   /* Reduced padding */
   border-radius: 8px;
   border: 1px solid #ddd;
   background: white;
   font-family: 'Plus Jakarta Sans', sans-serif;
   font-size: 0.8rem;
   /* Reduced font size */
   outline: none;
   transition: all 0.2s;
   pointer-events: auto;
   user-select: text;
   height: 32px;
}

.sidebar-input:focus {
   border-color: var(--primary);
   box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.1);
}

.transport-options {
   display: flex;
   flex-direction: column;
   gap: 6px;
   margin-top: 2px;
}

.transport-btn {
   flex: 1;
   padding: 6px;
   /* Reduced padding */
   border: 1px solid #ddd;
   border-radius: 8px;
   background: white;
   cursor: pointer;
   font-weight: 600;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 4px;
   transition: all 0.2s;
   color: var(--text-muted);
   font-size: 0.75rem;
   /* Reduced font size */
}

.transport-btn.active {
   background: var(--primary);
   color: white;
   border-color: var(--primary);
}

.transport-btn:hover:not(.active) {
   background: #f8f9fa;
}

.btn-calculate {
   width: 100%;
   margin-top: 8px;
   padding: 8px;
   /* Reduced padding */
   background: var(--primary);
   color: white;
   border: none;
   border-radius: 10px;
   font-weight: 700;
   cursor: pointer;
   transition: opacity 0.2s;
   font-size: 0.85rem;
}

.btn-calculate:hover {
   opacity: 0.9;
}

.result-card {
   background: #f8f9fa;
   border-radius: 12px;
   padding: 16px;
   margin-top: 16px;
   border: 1px solid #eee;
   display: none;
   flex-direction: column;
   flex-shrink: 0;
   overflow: visible;
}

.result-card.visible {
   display: flex;
   animation: fadeIn 0.3s ease;
}

.flight-list {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.result-row {
   display: flex;
   justify-content: space-between;
   margin-bottom: 8px;
   font-size: clamp(0.95rem, 1.2vw, 1.05rem);
}

.result-value {
   font-weight: 700;
   color: var(--secondary);
}

.co2-badge {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   background: #e6fffa;
   color: #047857;
   padding: 6px 10px;
   border-radius: 8px;
   font-size: 0.85rem;
   font-weight: 700;
   margin-top: 8px;
}

/* Bottom Flight Panel */
/* Bottom Flight Panel */
.bottom-panel {
   position: fixed;
   bottom: 8px;
   left: 50%;
   transform: translateX(-50%);
   width: 98%;
   max-width: none;
   height: 170px;
   /* Reduced height */
   background: rgba(255, 255, 255, 0.95);
   backdrop-filter: blur(16px);
   -webkit-backdrop-filter: blur(16px);
   border-radius: 16px;
   border: 1px solid rgba(255, 255, 255, 0.5);
   box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
   z-index: 900;
   /* Sidebar is 1000, so this slips under if they overlap */
   padding: 8px 12px;
   /* Compact padding */
   display: none;
   /* Hidden by default */
   flex-direction: column;
   animation: slideUp 0.4s ease;
   pointer-events: auto;
}

.bottom-panel.visible {
   display: flex;
}

@keyframes slideUp {
   from {
      transform: translate(-50%, 100%);
      opacity: 0;
   }

   to {
      transform: translate(-50%, 0);
      opacity: 1;
   }
}

/* Horizontal Flight List for Compact View */
.bottom-panel .flight-list {
   display: flex;
   flex-direction: row;
   gap: 12px;
   overflow-x: auto;
   overflow-y: hidden;
   padding: 4px;
   height: 100%;
   align-items: center;

   /* Scrollbar styling for horizontal */
   scrollbar-width: thin;
   scrollbar-color: #cbd5e1 transparent;
}

.bottom-panel .flight-list::-webkit-scrollbar {
   height: 6px;
}

.bottom-panel .flight-list::-webkit-scrollbar-thumb {
   background-color: #cbd5e1;
   border-radius: 4px;
}

.bottom-panel .flight-card {
   height: auto;
   min-width: 280px;
   flex-shrink: 0;
}

/* Suggestions Autocomplete */
.suggestions-list {
   position: absolute;
   top: 100%;
   left: 0;
   right: 0;
   background: white;
   border: 1px solid rgba(0, 0, 0, 0.1);
   border-radius: 12px;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
   z-index: 1000;
   max-height: 250px;
   overflow-y: auto;
   display: none;
   margin-top: 6px;
   padding: 6px;
}

.suggestions-list.visible {
   display: block;
   animation: fadeIn 0.2s ease;
}

.suggestion-item {
   padding: 10px 14px;
   font-size: 0.9rem;
   color: #444;
   cursor: pointer;
   border-radius: 8px;
   transition: background 0.15s;
   display: flex;
   align-items: center;
   gap: 10px;
}

.suggestion-item:hover {
   background: #f0f0f5;
   color: #000;
}

.suggestion-item .icon {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 24px;
   height: 24px;
   background: #eef2ff;
   border-radius: 50%;
   color: var(--primary);
   font-size: 0.8rem;
   flex-shrink: 0;
}

.suggestion-match {
   font-weight: 600;
   color: var(--primary);
}

.suggestion-secondary {
   font-size: 0.8rem;
   color: #888;
   margin-left: auto;
}

/* Transit Steps Styles for Bus/Train Results */
.transit-steps {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 6px;
   margin-top: 8px;
   font-size: 0.85rem;
   color: #4b5563;
}

.steps-arrow {
   font-size: 0.7rem;
   color: #9ca3af;
}

.transit-times {
   font-weight: 700;
   color: #1e293b;
   margin-top: 6px;
   font-size: 0.95rem;
}

.transit-pill {
   padding: 3px 10px;
   border-radius: 6px;
   font-weight: 600;
   font-size: 0.75rem;
   white-space: nowrap;
   display: inline-flex;
   align-items: center;
   gap: 6px;
   box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Mode Specific Colors */
.transit-pill.mode-bus {
   background: #e0f2fe;
   color: #0369a1;
   border: 1px solid #bae6fd;
}

.transit-pill.mode-coach {
   background: #dbeafe;
   color: #1e40af;
   border: 1px solid #bfdbfe;
}

.transit-pill.mode-train,
.transit-pill.mode-rail {
   background: #fce7f3;
   color: #be185d;
   border: 1px solid #fbcfe8;
}

.transit-pill.mode-metro,
.transit-pill.mode-rapid-transit {
   background: #f3e8ff;
   color: #7e22ce;
   border: 1px solid #e9d5ff;
}

.transit-pill.mode-tram {
   background: #d1fae5;
   color: #047857;
   border: 1px solid #a7f3d0;
}

.transit-pill.mode-walk {
   background: #f3f4f6;
   color: #4b5563;
   border: 1px dashed #d1d5db;
}

.transit-pill.mode-funicular {
   background: #ffedd5;
   color: #c2410c;
   border: 1px solid #fed7aa;
}