/* Premium Flight Search Wrapper v2 */
:root {
  --fs-primary: #2563EB;
  --fs-primary-dark: #1d4ed8;
  --fs-bg: #FFFFFF;
  --fs-border: #E5E7EB;
  --fs-text-main: #111827;
  --fs-text-muted: #6B7280;
}

.tag-flight-search-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 40px;
  position: relative;
  z-index: 20;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Trip Type Glass Segmented Control */
.tag-fs-triptype.glass-control {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 12px; /* 12px gap to search box */
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.tag-fs-tab {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 8px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}
.tag-fs-tab input[type="radio"] {
  display: none;
}
.tag-fs-tab:hover:not(.disabled):not(.active) {
  background: rgba(255, 255, 255, 0.1);
}
.tag-fs-tab.active {
  background: #ffffff;
  color: var(--fs-text-main);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.tag-fs-tab.disabled {
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
}

/* Unified Search Container */
.tag-fs-container {
  background-color: var(--fs-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 20px 40px -10px rgba(0, 0, 0, 0.2);
  display: flex;
  border: 1px solid var(--fs-border);
  position: relative;
  height: 80px;
  align-items: center;
}

/* Blocks */
.tag-fs-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
  height: 100%;
  border-right: 1px solid var(--fs-border);
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s;
}
.tag-fs-block:hover {
  background-color: #F9FAFB;
}
.tag-fs-block:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}
.tag-fs-block.no-border {
  border-right: none;
}
.tag-fs-block:focus-within {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--fs-primary);
  border-radius: 12px;
  border-right-color: transparent;
  z-index: 5;
}

/* Typography */
.fs-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--fs-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.fs-main-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--fs-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.fs-sub-text {
  font-size: 13px;
  color: var(--fs-text-muted);
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.2;
}

/* Hidden Inputs Overlay */
.fs-hidden-input, .fs-native-date {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
  z-index: 2;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--fs-text-main);
  padding: 0 24px;
}
.fs-native-date {
  cursor: pointer;
}
.fs-custom-display {
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transition: opacity 0.1s;
}

/* When typing in origin/dest */
.fs-hidden-input:focus {
  opacity: 1;
  z-index: 3;
}
.fs-hidden-input:focus + input[type="hidden"] + .fs-custom-display {
  opacity: 0;
}

/* Swap Button */
.tag-fs-swap-btn {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background-color: var(--fs-bg);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid var(--fs-border);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s;
  font-size: 16px;
  color: var(--fs-primary);
}
.tag-fs-swap-btn:hover {
  transform: translate(-50%, -50%) rotate(180deg);
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* Inline Search Button */
.tag-fs-btn-inline {
  height: 100%;
  padding: 0 32px;
  border: none;
  background: linear-gradient(135deg, var(--fs-primary) 0%, var(--fs-primary-dark) 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}
.tag-fs-btn-inline:hover {
  box-shadow: inset 0 0 0 100px rgba(0,0,0,0.1);
}
.tag-fs-btn-inline svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Dropdowns & Popovers */
.tag-fs-dropdown, .tag-fs-pax-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  z-index: 100;
  display: none;
  padding: 8px 0;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}
.tag-fs-dropdown.active, .tag-fs-pax-popover.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Autocomplete Items */
.fs-suggestion {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.fs-suggestion:hover {
  background: #f1f5f9;
}
.fs-suggestion-name {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
}
.fs-suggestion-iata {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.fs-suggestion-type {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Pax Popover Content */
.tag-fs-pax-popover {
  padding: 20px;
  width: 340px;
  right: 0;
  left: auto;
}
.pax-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pax-row strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
}
.pax-row span {
  font-size: 12px;
  color: #64748b;
}
.pax-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pax-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #2563eb;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.pax-btn:hover {
  border-color: #2563eb;
  background: #f1f5f9;
}
.pax-btn:disabled {
  color: #cbd5e1;
  border-color: #e2e8f0;
  cursor: not-allowed;
}
.pax-controls input {
  width: 24px;
  text-align: center;
  border: none;
  font-weight: 700;
  font-size: 16px;
  padding: 0;
  background: transparent;
  outline: none;
}
.tag-fs-pax-popover hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}
.class-row label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.class-row select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
}
.pax-done-btn {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  margin-top: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.pax-done-btn:hover {
  background: #1e293b;
}

/* Trust Indicators */
.tag-fs-trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
}
.tag-fs-trust span {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.tag-fs-trust svg {
  color: #4ade80;
}

/* Responsive */
@media (max-width: 1024px) {
  .tag-fs-container {
    flex-wrap: wrap;
    height: auto;
    border-radius: 12px;
  }
  .tag-fs-block {
    flex: 1 1 50%;
    height: 80px;
    border-right: none;
    border-bottom: 1px solid var(--fs-border);
  }
  .tag-fs-block:first-child {
    border-radius: 12px 0 0 0;
  }
  .tag-fs-swap-btn {
    left: 50%;
    top: 100%;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .tag-fs-swap-btn:hover {
    transform: translate(-50%, -50%) rotate(270deg);
  }
  .tag-fs-btn-inline {
    flex: 1 1 100%;
    height: 60px;
    border-radius: 0 0 12px 12px;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .tag-flight-search-wrapper {
    padding: 16px;
  }
  .tag-fs-block {
    flex: 1 1 100%;
    border-radius: 0 !important;
  }
  .tag-fs-block:first-child {
    border-radius: 12px 12px 0 0 !important;
  }
  .tag-fs-pax-popover {
    width: 100%;
  }
  .tag-fs-trust {
    flex-wrap: wrap;
    gap: 12px;
  }
}
