/* Modern Airlines Manager Tycoon Calculator Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --eco-accent: #06b6d4;
  --bus-accent: #3b82f6;
  --first-accent: #f59e0b;
  --cargo-accent: #a855f7;
  color-scheme: dark;
}

select {
  color-scheme: dark;
}

select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

select optgroup {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-mono-num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Input spinners removal */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.glass-card {
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease-in-out;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35);
}

.glass-card-fulfilled {
  border-color: rgba(16, 185, 129, 0.5) !important;
  background: rgba(6, 78, 59, 0.15) !important;
  box-shadow: 0 0 16px -2px rgba(16, 185, 129, 0.18) !important;
}

.glass-card-fulfilled:hover {
  border-color: rgba(52, 211, 153, 0.7) !important;
  box-shadow: 0 0 24px -2px rgba(16, 185, 129, 0.28) !important;
}

/* Tooltip transition */
.tooltip-content {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  transform: translateY(4px);
}

.has-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Seat distribution bar segments */
.seat-bar-eco {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}
.seat-bar-bus {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.seat-bar-first {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.seat-bar-cargo {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Tab button transition */
.tab-btn-active {
  background-color: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 15px -3px rgba(6, 182, 212, 0.2);
}
.tab-btn-inactive {
  background-color: transparent;
  color: #94a3b8;
  border-color: transparent;
}
.tab-btn-inactive:hover {
  background-color: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
}

/* Drag and drop states for circuit legs */
.circuit-leg-item {
  cursor: grab;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.circuit-leg-item:active {
  cursor: grabbing;
}
.circuit-leg-item.dragging {
  opacity: 0.35;
  transform: scale(0.99);
  border-color: #06b6d4 !important;
}
.circuit-leg-item.drag-over {
  border-color: #22d3ee !important;
  background-color: rgba(6, 182, 212, 0.12) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

/* 24h & 168h Schedule Grid */
.grid-cols-25 {
  display: grid;
  grid-template-columns: 50px repeat(24, minmax(0, 1fr));
}
.grid-cols-24 {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
}
.col-span-24 {
  grid-column: span 24 / span 24;
}

.timeline-day-track {
  position: relative;
  height: 34px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.45);
  border-radius: 6px;
  overflow: hidden;
}

.timeline-hour-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px dashed rgba(51, 65, 85, 0.35);
  pointer-events: none;
}

/* Flight Block in Timeline */
.timeline-flight-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: filter 0.15s ease, transform 0.15s ease;
  z-index: 5;
}
.timeline-flight-block:hover {
  filter: brightness(1.15);
  z-index: 10;
  transform: scaleY(1.05);
}

/* Accordion collapse utility */
.accordion-collapsed {
  display: none !important;
}

/* Saved Circuits Modal & Dropzone Styles */
.circuit-dropzone {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.circuit-dropzone:hover {
  border-color: #06b6d4 !important;
  background-color: rgba(6, 182, 212, 0.05) !important;
}

/* Timeline remaining slots striped pattern */
.timeline-striped {
  background: repeating-linear-gradient(
    -45deg,
    rgba(30, 41, 59, 0.8),
    rgba(30, 41, 59, 0.8) 10px,
    rgba(15, 23, 42, 0.9) 10px,
    rgba(15, 23, 42, 0.9) 20px
  );
}

/* Floating Demand Basis Popover & Config Financial Popover */
#circuit_demand_popover,
#circuit_config_financial_popover {
  animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Badge Pill Utility Class */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  border-width: 1px;
}

/* ==========================================================================
   Compact Mode Styles (Sidebar Extension & Dense View)
   ========================================================================== */
body.amt-compact-mode #zero_out_standard_container {
  display: none !important;
}

body.amt-compact-mode #zero_out_compact_container {
  display: block !important;
}

#zero_out_compact_container {
  display: none;
}

/* Micro input styles for Compact Mode */
.amt-micro-input {
  background-color: #0b1120;
  border: 1px solid #1e293b;
  color: #f8fafc;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 6px;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
}

.amt-micro-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
  background-color: #0f172a;
}

/* Compact Draggable FAB */
body.amt-compact-mode #zo_floating_actions { display: none !important; }
body.amt-compact-mode #zo_compact_fab { display: block !important; }
body:not(.amt-compact-mode) #zo_compact_fab { display: none !important; }

#zo_compact_fab {
  pointer-events: none !important;
  width: max-content;
  height: max-content;
}
#zo_fab_container {
  pointer-events: none !important;
}
#zo_fab_trigger {
  pointer-events: auto !important;
}

.fab-menu {
  position: absolute;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
  z-index: 60;
}
.fab-menu.closed {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.85) translateY(6px);
}
.fab-menu.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: scale(1) translateY(0);
}
#zo_compact_fab.is-dragging {
  opacity: 0.92;
  user-select: none;
  -webkit-user-select: none;
}
#zo_compact_fab.is-dragging #zo_fab_trigger {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.7);
}

/* Hide logo/title, Home nav button, homepage view, and install link in extension/sidebar */
html.amt-extension #header_brand_logo,
body.amt-extension #header_brand_logo,
body.amt-compact-mode #header_brand_logo,
html.amt-extension #nav_home,
body.amt-extension #nav_home,
html.amt-extension #view_home,
body.amt-extension #view_home,
html.amt-extension #header_get_addon,
body.amt-extension #header_get_addon,
html.amt-extension #btn_open_sync_modal,
body.amt-extension #btn_open_sync_modal,
body.amt-compact-mode #btn_open_sync_modal,
html.amt-extension a[href="#install-guide"],
body.amt-extension a[href="#install-guide"] {
  display: none !important;
}

html.amt-extension header > div,
body.amt-extension header > div,
body.amt-compact-mode header > div {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  justify-content: center !important;
  gap: 0.5rem !important;
}

/* Ensure Compact Route Finder Aircraft dropdown appears above Departure Hub, Criteria filters and tabs */
#rf_c_topline,
.sc-topline {
  position: relative;
  z-index: 45;
}
#rf_c_topline.is-open,
.sc-topline.is-open,
.sc-topline:has(.sc-combobox-popover) {
  z-index: 70 !important;
}
#rf_c_ac_root,
.sc-combobox-root {
  position: relative;
  z-index: 50;
}
#rf_c_ac_root.is-open,
.sc-combobox-root.is-open,
.sc-combobox-root:has(.sc-combobox-popover) {
  z-index: 70 !important;
}
#rf_c_ac_popover,
.sc-combobox-popover {
  z-index: 100 !important;
}
.sc_layout_tabs {
  z-index: 10 !important;
}
#rf_c_hub_input {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  flex: 0 0 44px !important;
  padding: 3px 5px !important;
  text-align: center !important;
  min-height: 25px !important;
  font-weight: 700 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  text-transform: uppercase !important;
  box-sizing: border-box !important;
}
#rf_c_hub_input::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  width: 0 !important;
}
.sc-browse-btn {
  padding: 3px 8px !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  border-radius: 5px !important;
  white-space: nowrap !important;
  min-height: 25px !important;
  border: 1px solid #304056 !important;
  background: #101f32 !important;
  color: #94cee0 !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
}
.sc-browse-btn:hover {
  background: #172a44 !important;
  color: #c8effc !important;
  border-color: #3b5578 !important;
}
