/* gcd.css — Great Circle Distance route panel */

/* ============================================================
   GCD PANEL (slide-in left — mirrors airport-panel)
   ============================================================ */

.gcd-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 400px;
  background: rgba(27, 29, 35, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  z-index: 10;
  color: var(--dsc-text);
  padding: 20px 16px;
  padding-top: 48px;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.gcd-panel.open {
  transform: translateX(0);
}

.gcd-panel h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #00aeef;
}

.gcd-panel h3 i {
  margin-right: 8px;
}

.gcd-panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--dsc-border);
  color: var(--dsc-text-muted);
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
  z-index: 11;
}

.gcd-panel-close:hover {
  background: var(--dsc-danger);
  color: #fff;
}

/* Scrollbar */
.gcd-panel::-webkit-scrollbar { width: 6px; }
.gcd-panel::-webkit-scrollbar-track { background: transparent; }
.gcd-panel::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.15); border-radius: 999px; }

/* ============================================================
   INPUT GROUP
   ============================================================ */

.gcd-input-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.gcd-input-row {
  flex: 1;
  position: relative;
}

.gcd-input-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dsc-text-muted, #aaa);
  margin-bottom: 4px;
}

.gcd-input-row input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--dsc-text);
  font-size: 14px;
  font-family: var(--dsc-font);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.gcd-input-row input:focus {
  border-color: var(--dsc-primary, #00aeef);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
  outline: none;
}

.gcd-swap-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dsc-text-muted, #aaa);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 20px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.gcd-swap-btn:hover {
  background: rgba(0, 174, 239, 0.15);
  color: #00aeef;
}

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */

.gcd-autocomplete {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--dsc-bg-secondary, #1a1a2e);
  border: 1px solid var(--dsc-border, #333);
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gcd-autocomplete .gcd-ac-item {
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s ease;
}

.gcd-autocomplete .gcd-ac-item:hover,
.gcd-autocomplete .gcd-ac-item.active {
  background: rgba(0, 174, 239, 0.12);
}

.gcd-autocomplete .gcd-ac-item .gcd-ac-icao {
  font-weight: 700;
  color: #00aeef;
  margin-right: 6px;
}

.gcd-autocomplete .gcd-ac-item .gcd-ac-iata {
  color: var(--dsc-text-muted, #aaa);
  margin-right: 6px;
}

/* ============================================================
   OPERATION TYPE SELECT
   ============================================================ */

.gcd-op-type {
  margin-bottom: 12px;
}

.gcd-op-type label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dsc-text-muted, #aaa);
  margin-bottom: 4px;
}

.gcd-op-type select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 13px;
  font-family: var(--dsc-font);
  cursor: pointer;
  transition: border-color 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.gcd-op-type select:focus {
  border-color: var(--dsc-primary, #00aeef);
  outline: none;
}

.gcd-op-type select option {
  background: #1e293b;
  color: #e2e8f0;
}

/* ============================================================
   ACTION BUTTONS
   ============================================================ */

.gcd-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.gcd-calc-btn {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 8px;
  background: #00aeef;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--dsc-font);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gcd-calc-btn:hover {
  background: #0095d0;
}

.gcd-calc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gcd-clear-btn {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: transparent;
  color: var(--dsc-text-muted, #aaa);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--dsc-font);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.gcd-clear-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ============================================================
   RESULTS AREA
   ============================================================ */

#gcd-results {
  font-size: 13px;
  line-height: 1.6;
}

/* Loading spinner */
.gcd-loading {
  text-align: center;
  padding: 24px 0;
  color: var(--dsc-text-muted, #aaa);
}

.gcd-loading i {
  font-size: 24px;
  animation: gcd-spin 1s linear infinite;
  display: block;
  margin-bottom: 8px;
  color: #00aeef;
}

@keyframes gcd-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Error */
.gcd-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  color: #fca5a5;
}

/* Distance header */
.gcd-distance {
  text-align: center;
  margin-bottom: 16px;
}

.gcd-distance .gcd-dist-value {
  font-size: 28px;
  font-weight: 700;
  color: #00aeef;
}

.gcd-distance .gcd-dist-nm {
  font-size: 16px;
  color: var(--dsc-text-muted, #aaa);
  margin-left: 6px;
}

.gcd-distance .gcd-dist-label {
  display: block;
  font-size: 11px;
  color: var(--dsc-text-muted, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Domestic flight banner */
.gcd-domestic {
  text-align: center;
  padding: 14px;
  background: rgba(0, 174, 239, 0.06);
  border-radius: 8px;
  color: var(--dsc-text-muted, #aaa);
}

.gcd-domestic i {
  font-size: 18px;
  color: #00aeef;
  margin-right: 6px;
}

/* Route summary (country chain) */
.gcd-route-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.gcd-route-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.gcd-route-chip.origin {
  background: rgba(0, 174, 239, 0.15);
  color: #00aeef;
}

.gcd-route-chip.transit {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gcd-route-chip.destination {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.gcd-route-arrow {
  color: var(--dsc-text-muted, #555);
  font-size: 12px;
}

/* Avoid toggle button inside transit chips */
.gcd-avoid-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(234, 179, 8, 0.5);
  background: transparent;
  color: rgba(234, 179, 8, 0.6);
  font-size: 9px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.gcd-avoid-toggle:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.gcd-avoid-toggle.active {
  border-color: #ef4444;
  color: #fff;
  background: #ef4444;
}

/* Avoided chip state */
.gcd-route-chip.avoided {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
  text-decoration: line-through;
  opacity: 0.7;
}

/* Avoid banner */
.gcd-avoid-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  font-size: 12px;
  font-weight: 600;
  color: #fca5a5;
}

.gcd-avoid-banner i {
  color: #ef4444;
  font-size: 13px;
}

/* Original distance (shown below adjusted distance) */
.gcd-dist-original {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--dsc-text-muted, #888);
}

.gcd-dist-penalty {
  color: #f59e0b;
  font-weight: 600;
}

/* Avoid feature hint */
.gcd-avoid-hint {
  text-align: center;
  font-size: 11px;
  color: var(--dsc-text-muted, #777);
  margin-bottom: 12px;
  padding: 6px 10px;
  background: rgba(234, 179, 8, 0.06);
  border-radius: 6px;
  border: 1px dashed rgba(234, 179, 8, 0.2);
}

.gcd-avoid-hint i {
  color: #eab308;
  margin-right: 4px;
  font-size: 10px;
}

.gcd-avoid-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(234, 179, 8, 0.5);
  font-size: 0;
  vertical-align: middle;
  margin: 0 2px;
  position: relative;
}

.gcd-avoid-hint-icon::after {
  content: '\f05e';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 8px;
  color: rgba(234, 179, 8, 0.6);
}

/* Country permit card */
.gcd-country-card {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid;
}

.gcd-country-card.transit {
  background: rgba(234, 179, 8, 0.06);
  border-left-color: #eab308;
}

.gcd-country-card.destination {
  background: rgba(16, 185, 129, 0.06);
  border-left-color: #10b981;
}

.gcd-country-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

.gcd-country-card.transit h4 { color: #eab308; }
.gcd-country-card.destination h4 { color: #10b981; }

.gcd-country-card .gcd-role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.gcd-country-card.transit .gcd-role-badge {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.gcd-country-card.destination .gcd-role-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.gcd-country-card .gcd-firs {
  font-size: 11px;
  color: var(--dsc-text-muted, #aaa);
  margin-bottom: 8px;
}

.gcd-permit-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.gcd-permit-table td {
  padding: 3px 6px;
  vertical-align: top;
}

.gcd-permit-table td:first-child {
  color: var(--dsc-text-muted, #aaa);
  width: 110px;
  white-space: nowrap;
}

.gcd-no-permit {
  font-size: 12px;
  color: var(--dsc-text-muted, #aaa);
  font-style: italic;
}

/* Processing time badge (in card header) */
.gcd-processing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.gcd-processing-badge i { font-size: 9px; }

.gcd-processing-badge.fast {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}

.gcd-processing-badge.medium {
  background: rgba(234, 179, 8, 0.18);
  color: #eab308;
}

.gcd-processing-badge.slow {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

/* Inline days label next to section header */
.gcd-days-inline {
  font-size: 10px;
  font-weight: 600;
  color: var(--dsc-text-muted, #888);
  margin-left: 8px;
}

/* Selected operation type highlight */
.gcd-ops-highlight {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 174, 239, 0.1);
  border-left: 3px solid #00aeef;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

.gcd-ops-highlight i {
  color: #00aeef;
  margin-right: 4px;
}

.gcd-ops-highlight strong {
  color: #e2e8f0;
}

/* Operation type collapsible section */
.gcd-ops-section {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.gcd-ops-toggle {
  font-size: 11px;
  font-weight: 600;
  color: var(--dsc-text-muted, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: color 0.15s ease;
}

.gcd-ops-toggle:hover { color: #00aeef; }

.gcd-ops-chevron {
  font-size: 9px;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.gcd-ops-section.open .gcd-ops-chevron {
  transform: rotate(180deg);
}

.gcd-ops-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.gcd-ops-section.open .gcd-ops-body {
  max-height: 500px;
}

.gcd-ops-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.gcd-ops-item:last-child { border-bottom: none; }

.gcd-ops-item strong {
  font-size: 11px;
  color: #00aeef;
  display: block;
  margin-bottom: 2px;
}

.gcd-ops-item p {
  font-size: 11px;
  color: var(--dsc-text-muted, #aaa);
  margin: 0;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ============================================================
   TOOLBAR BETA BADGE
   ============================================================ */

.toolbar-beta-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.25);
  color: #eab308;
  pointer-events: none;
}

/* ============================================================
   "SHARE ROUTE" BUTTON
   ============================================================ */

.gcd-share-btn {
  display: block;
  width: 100%;
  padding: 12px 0;
  margin-top: 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00aeef, #0077b6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--dsc-font);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.gcd-share-btn i {
  margin-right: 6px;
}

.gcd-share-btn:hover {
  background: linear-gradient(135deg, #0095d0, #005f8f);
}

.gcd-share-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   "SEE ON MAP" BUTTON (inside results, mobile)
   ============================================================ */

.gcd-see-map-btn {
  display: none;
  width: 100%;
  padding: 12px 0;
  margin-top: 14px;
  border: none;
  border-radius: 8px;
  background: #ff2d2d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--dsc-font);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gcd-see-map-btn i {
  margin-right: 6px;
}

.gcd-see-map-btn:hover {
  background: #e02020;
}

/* ============================================================
   "BACK TO ROUTE" FLOATING BUTTON (on map)
   ============================================================ */

.gcd-back-btn {
  display: none;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: rgba(27, 29, 35, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--dsc-font);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}

.gcd-back-btn i {
  margin-right: 6px;
  color: #ff2d2d;
}

.gcd-back-btn:hover {
  background: rgba(40, 42, 50, 0.95);
}

.gcd-back-btn.visible {
  display: block;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .gcd-panel {
    width: 100%;
    border-right: none;
  }

  .gcd-see-map-btn {
    display: block;
  }

  /* Prevent iOS auto-zoom on input focus */
  .gcd-input-row input {
    font-size: 16px;
  }
}
