/* --- AI Modal General Styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0);
  justify-content: center;
  align-items: center;
  transition: background-color 0.5s cubic-bezier(0.32, 0.72, 0.33, 1.5);
}

.modal.show {
  display: flex !important;
  background-color: rgba(0, 0, 0, 0.6); /* Slightly darker overlay */
}

.modal-content {
  background-color: var(--wht);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 840px;
  width: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 92vh;
  overflow-y: auto;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0.33, 1.5), opacity 0.4s ease;
}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-content h2 {
  color: var(--blk);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray100);
}

.close-button {
  color: var(--gray500);
  font-size: 26px;
  font-weight: bold;
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.close-button:hover,
.close-button:focus {
  color: var(--blk);
  transform: rotate(90deg);
}

/* --- Modal Content Container --- */
.flight-results-container {
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  color: var(--gray600);
  font-size: 16px;
  font-style: italic;
  transition: background-color 0.3s ease;
  flex-grow: 1;
  overflow-y: auto;
}

#ai-status-message {
  font-size: 16px;
  font-weight: 500;
  margin: 20px 0;
}

/* --- AI Modal Loading Status --- */
.ai-loading-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--gray600);
  font-size: 15px;
  width: 100%;
  min-height: 300px; /* Ensure loading state has enough space */
  background: #f8f9ff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 20px;
  background: var(--wht);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#ai-loading-lottie {
  width: 70px;
  height: 70px;
  margin-bottom: 8px;
}

.ai-loading-progress {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 40px;
  width: 100%;
  padding: 22px;
  background: #f5f7ff;
  border-radius: 10px;
  border: 1px solid var(--gray100);
}

.ai-loading-progress .step {
  display: flex;
  align-items: center;
  font-size: 16px;
  color: var(--gray400);
  transition: color 0.3s ease;
}

.ai-loading-progress .circle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray50);
  color: var(--primary);
  margin-right: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}

.ai-loading-progress .step[data-status="done"] .circle {
  background: var(--secondary);
  color: var(--wht);
}

.ai-loading-progress .step[data-status="done"] .circle::before {
  content: '✓';
}

.ai-loading-progress .step[data-status="active"] .circle {
  background: var(--primary);
  color: var(--wht);
  animation: pulse 1.2s infinite ease-in-out;
}

.ai-loading-progress .step[data-status="done"] {
  color: var(--secondary);
  font-weight: 600;
}

.ai-loading-progress .step[data-status="active"] {
  color: var(--primary);
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

#ai-loading-text {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
  transition: opacity 0.3s ease-in-out;
  text-align: center;
}

/* --- AI Final Results Container --- */
#ai-final-results {
  width: 100%;
  height: auto;
  text-align: left;
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Custom Scrollbar for Modal */
.custom-scrollbar::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.flight-results-container::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.flight-results-container::-webkit-scrollbar-track {
  background: var(--gray50);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.flight-results-container::-webkit-scrollbar-thumb {
  background: var(--gray300);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.flight-results-container::-webkit-scrollbar-thumb:hover {
  background: var(--gray500);
}

/* --- AI Insight --- */
.ai-insight {
  background-color: #e9f5ff;
  padding: 14px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-insight-badge {
  background: var(--gradient-blue-green);
  color: var(--wht);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

#ai-insight-text {
  font-size: 14px;
  color: var(--gray700);
  font-style: normal;
  line-height: 1.6;
}

/* --- Flight Cards --- */
#ai-flight-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-flight-card {
  display: grid; /* Changed to Grid */
  grid-template-columns: auto 1fr auto; /* Default for larger screens */
  grid-template-areas:
    "header main button"; /* Define areas for larger screens */
  align-items: center;
  padding: 14px;
  border: 1px solid var(--gray100);
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.ai-flight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-flight-card.highlight {
  border: 2px solid var(--primary);
  background-color: #f7fbff;
  padding: 16px;
}

.flight-card-header {
  grid-area: header; /* Assign to header area */
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0; /* No margin-bottom needed with grid layout */
  padding-right: 15px; /* Add some spacing */
}

.airline-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.airline-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray700);
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--wht);
  margin-left: 8px; /* Add some spacing from airline name */
}

.badge.direct {
  background: #37a35b;
}

.badge.special {
  background: #f37a22;
}

.badge.recommend {
  background: #2186eb;
}

.flight-card-main {
  grid-area: main; /* Assign to main area */
  display: flex;
  flex-direction: row; /* Keep as row for larger screens */
  justify-content: space-between;
  align-items: center;
  padding: 0 10px; /* Adjust padding for grid layout */
  gap: 12px;
  width: 100%;
}

.flight-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  flex: 1;
  justify-content: center; /* Center content horizontally */
}

.time-airport {
  text-align: center;
  min-width: 100px;
}

.airport {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray700);
}

.flight-time {
  font-size: 18px;
  font-weight: 700;
  color: var(--blk);
}

.date {
  font-size: 13px;
  color: var(--gray500);
}

.arrow {
  font-size: 18px;
  color: var(--primary);
  font-weight: bold;
}

.flight-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Align price and button to the right */
  gap: 6px;
  font-size: 13px;
  color: var(--gray600);
  padding-left: 10px; /* Add some spacing */
}

.price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.select-btn {
  grid-area: button; /* Assign to button area */
  background-color: var(--primary);
  color: var(--wht);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.2s ease;
  width: auto; /* Allow button to size based on content */
  min-width: 120px; /* Set a minimum width for consistency */
  text-align: center;
  margin-left: 15px; /* Add some spacing from flight details */
}

/* ── EZ AI product results ───────────────────────────────────────────────── */
.modal-content {
  max-width: 980px;
  padding: 28px;
  border: 1px solid rgba(25, 135, 250, 0.1);
  box-shadow: 0 28px 80px rgba(18, 61, 95, 0.22);
}

.modal-content > h2 {
  padding-right: 40px;
  color: #253747;
}

.ezai-loading {
  width: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 36px 24px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(25, 135, 250, .09), transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(16, 194, 160, .11), transparent 25%),
    #fbfdff;
}

.ezai-loading[hidden],
.ezai-results[hidden],
.ezai-error[hidden],
.ezai-provider-note[hidden],
.ezai-compare[hidden] {
  display: none !important;
}

.ezai-loading-mark {
  width: 82px;
  height: 82px;
}

.ezai-loading-title {
  margin: 0;
  color: #263d4c;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.ezai-loading-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(680px, 100%);
  margin-top: 8px;
}

.ezai-step {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px 13px;
  border: 1px solid var(--gray100);
  border-radius: 12px;
  background: #fff;
  color: var(--gray500);
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.ezai-step span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gray50);
  color: var(--gray500);
  font-size: 11px;
  font-weight: 800;
}

.ezai-step strong { font-size: 13px; }

.ezai-step[data-status="active"] {
  border-color: rgba(25, 135, 250, .35);
  background: #f3f9ff;
  color: var(--primary);
  transform: translateY(-2px);
}

.ezai-step[data-status="active"] span {
  background: var(--primary);
  color: #fff;
  animation: ezai-step-pulse 1.15s ease-in-out infinite;
}

.ezai-step[data-status="done"] {
  border-color: rgba(16, 194, 160, .28);
  background: #f4fffc;
  color: #078e73;
}

.ezai-step[data-status="done"] span {
  background: var(--secondary);
  color: transparent;
  position: relative;
}

.ezai-step[data-status="done"] span::after {
  content: '✓';
  position: absolute;
  color: #fff;
}

@keyframes ezai-step-pulse {
  50% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(25, 135, 250, .08); }
}

.ezai-results {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  font-style: normal;
}

.ezai-results-head,
.ezai-section-head,
.ezai-card-top,
.ezai-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ezai-results-head h3 {
  margin: 3px 0 0;
  color: #243847;
  font-size: 20px;
  letter-spacing: -.025em;
}

.ezai-kicker,
.ezai-section-head span {
  display: block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
}

.ezai-source {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(16, 194, 160, .2);
  border-radius: 999px;
  background: rgba(16, 194, 160, .08);
  color: #087d67;
  font-size: 11px;
  font-weight: 800;
}

.ezai-result-intent {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  width: 100%;
}

.ezai-result-intent .ai-intent-chip {
  background: #f7fbff;
}

.ezai-insight {
  margin: 0;
  border-left-color: var(--secondary);
  background: linear-gradient(135deg, rgba(25, 135, 250, .07), rgba(16, 194, 160, .08));
}

.ezai-insight p {
  margin: 0;
  color: #3f5361;
  font-size: 13px;
  line-height: 1.6;
}

.ezai-provider-note {
  padding: 10px 13px;
  border: 1px solid #f0d8a8;
  border-radius: 10px;
  background: #fffaf0;
  color: #7a5b2c;
  font-size: 12px;
  line-height: 1.55;
}

.ezai-flight-list {
  display: grid;
  gap: 10px;
}

.ezai-flight-card {
  padding: 16px 18px 13px;
  border: 1px solid #e7edf1;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(24, 57, 76, .05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ezai-flight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 24px rgba(24, 57, 76, .09);
}

.ezai-flight-card.is-selected {
  border-color: rgba(25, 135, 250, .42);
  box-shadow: 0 0 0 3px rgba(25, 135, 250, .08);
}

.ezai-airline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ezai-airline img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 9px;
  border: 1px solid #eef2f4;
  background: #fff;
}

.ezai-airline div { display: grid; gap: 2px; min-width: 0; }
.ezai-airline strong { color: #283c4a; font-size: 14px; }
.ezai-airline span { color: var(--gray500); font-size: 11px; }

.ezai-card-badges {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.ezai-card-badges span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eaf5ff;
  color: #1975cc;
  font-size: 10px;
  font-weight: 800;
}

.ezai-card-badges span:nth-child(3n) {
  background: #e8faf5;
  color: #078e73;
}

.ezai-route-row {
  display: grid;
  grid-template-columns: 120px minmax(150px, 1fr) 120px minmax(130px, auto);
  align-items: center;
  gap: 14px;
  padding: 16px 0 13px;
}

.ezai-endpoint { display: grid; gap: 2px; }
.ezai-endpoint.is-arrival { text-align: right; }
.ezai-endpoint strong { color: #203643; font-size: 20px; line-height: 1; }
.ezai-endpoint span { color: var(--primary); font-size: 13px; font-weight: 800; }
.ezai-endpoint small { color: var(--gray500); font-size: 10px; }

.ezai-route-line {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.ezai-route-line span,
.ezai-route-line small {
  color: var(--gray500);
  font-size: 10px;
  white-space: nowrap;
}

.ezai-route-line i {
  position: relative;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.ezai-route-line i::before,
.ezai-route-line i::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}

.ezai-route-line i::before { left: 0; }
.ezai-route-line i::after { right: 0; border-color: var(--secondary); }

.ezai-price {
  display: grid;
  gap: 3px;
  text-align: right;
}

.ezai-price strong {
  color: #213946;
  font-size: 18px;
  letter-spacing: -.02em;
}

.ezai-price span { color: var(--gray500); font-size: 10px; }

.ezai-card-actions {
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid #f0f3f5;
}

.ezai-compare-toggle,
.ezai-detail-link,
.ezai-modify button,
.ezai-followups button,
.ezai-link-btn {
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.ezai-compare-toggle,
.ezai-detail-link {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.ezai-compare-toggle {
  border: 1px solid #dfe7ec;
  background: #fff;
  color: #58707f;
}

.ezai-compare-toggle.is-on {
  border-color: rgba(25, 135, 250, .28);
  background: #eef7ff;
  color: var(--primary);
}

.ezai-detail-link {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: #fff;
}

.ezai-compare {
  padding: 14px;
  border: 1px solid rgba(25, 135, 250, .13);
  border-radius: 14px;
  background: #f9fcff;
}

.ezai-section-head strong {
  display: block;
  margin-top: 3px;
  color: #304653;
  font-size: 13px;
}

.ezai-link-btn {
  padding: 6px 8px;
  border-radius: 7px;
  background: #edf4f8;
  color: #617684;
  font-size: 10px;
  font-weight: 800;
}

.ezai-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.ezai-compare-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e4edf2;
  border-radius: 11px;
  background: #fff;
}

.ezai-compare-card strong,
.ezai-compare-card span,
.ezai-compare-card b,
.ezai-compare-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ezai-compare-card strong { color: #2f4552; font-size: 12px; }
.ezai-compare-card span, .ezai-compare-card small { color: var(--gray500); font-size: 10px; }
.ezai-compare-card b { color: var(--primary); font-size: 14px; }
.ezai-compare-card button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #f1f5f7;
  color: #748794;
  cursor: pointer;
}

.ezai-modify {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(16, 194, 160, .16);
  border-radius: 14px;
  background: #f8fffd;
}

.ezai-modify > div:first-child strong {
  display: block;
  margin-top: 3px;
  color: #304653;
  font-size: 12px;
}

.ezai-modify-input-row {
  display: flex;
  gap: 7px;
  min-width: 0;
}

.ezai-modify input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 13px;
  border: 1px solid #d9e7e3;
  border-radius: 9px;
  background: #fff;
  color: #2d424f;
  outline: none;
  font-size: 12px;
}

.ezai-modify input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(16, 194, 160, .1);
}

.ezai-modify button {
  min-width: 82px;
  border-radius: 9px;
  background: var(--gradient-blue-green);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.ezai-followups {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.ezai-followups button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(25, 135, 250, .12);
  border-radius: 999px;
  background: #f7fbff;
  color: #3f6f8c;
  font-size: 11px;
  font-weight: 700;
}

.ezai-error {
  width: 100%;
  padding: 30px;
  border: 1px solid #f0d7d4;
  border-radius: 16px;
  background: #fff9f8;
  text-align: center;
  font-style: normal;
}

.ezai-error strong { color: #7d3f3a; font-size: 16px; }
.ezai-error p { margin: 8px 0 0; color: #96625e; font-size: 13px; }
.ezai-error .ai-intent-preview { justify-content: center; padding-left: 0; }

.ezai-empty {
  padding: 28px 16px;
  border: 1px dashed #d8e2e8;
  border-radius: 12px;
  color: var(--gray500);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 760px) {
  .modal-content {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    padding: 20px 14px 16px;
    border-radius: 18px;
  }

  .modal-content > h2 { font-size: 18px; }
  .ezai-loading { min-height: 320px; padding: 26px 12px; }
  .ezai-loading-steps { grid-template-columns: 1fr; gap: 6px; }
  .ezai-step { min-height: 46px; }
  .ezai-results-head { align-items: flex-start; }
  .ezai-results-head h3 { font-size: 17px; }
  .ezai-result-intent { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .ezai-result-intent::-webkit-scrollbar { display: none; }
  .ezai-result-intent .ai-intent-chip { flex: 0 0 auto; }

  .ezai-route-row {
    grid-template-columns: minmax(64px, auto) minmax(90px, 1fr) minmax(64px, auto);
    gap: 8px;
  }

  .ezai-price {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
  }

  .ezai-endpoint strong { font-size: 17px; }
  .ezai-compare-grid { display: flex; overflow-x: auto; }
  .ezai-compare-card { flex: 0 0 min(220px, 72vw); }
  .ezai-modify { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 430px) {
  .ezai-airline strong { font-size: 12px; }
  .ezai-card-badges { gap: 3px; }
  .ezai-card-badges span { font-size: 9px; }
  .ezai-flight-card { padding: 13px 12px 11px; }
  .ezai-modify-input-row { flex-direction: column; }
  .ezai-modify button { min-height: 38px; }
  .ezai-card-actions { justify-content: stretch; }
  .ezai-card-actions > * { flex: 1; justify-content: center; }
}

.select-btn:hover {
  background-color: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- AI Recommendation Text --- */
.ai-recommendation-text {
  background-color: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--gray100);
  margin-top: 10px;
}

.ai-recommendation-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray700);
  margin: 0 0 8px 0;
}

#ai-additional-recommendation {
  font-size: 14px;
  color: var(--gray600);
  line-height: 1.6;
  margin: 0;
}

/* --- AI Follow-up Actions --- */
.ai-follow-up-actions {
  background: #f7fbff;
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 2px 6px rgba(33, 134, 235, 0.05);
}

.ai-chat-bubble {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: #e9f5ff;
  padding: 8px 14px;
  border-radius: 18px;
  display: inline-block;
  margin-bottom: 10px;
}

.follow-up-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-action-btn {
  border: none;
  background: #eef6fc;
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, transform 0.2s;
}

.ai-action-btn:hover {
  background: var(--primary);
  color: var(--wht);
  transform: translateY(-2px);
}

.ai-action-btn .icon {
  font-size: 15px;
}

/* --- Confetti Container --- */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1001;
}

/* --- Retry Button --- */
.retry-btn {
  background-color: var(--primary);
  color: var(--wht);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.retry-btn:hover {
  background-color: #1565c0;
  transform: translateY(-2px);
}

/* --- Responsive Adjustments --- */
@media (min-width: 768px) {
  /* No changes needed here, as the default grid setup handles larger screens */
}

@media (max-width: 767px) {
  .modal-content {
    padding: 16px;
    width: 95%;
    max-height: 90vh;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .close-button {
    font-size: 22px;
    top: 12px;
    right: 12px;
  }

  .ai-loading-status {
    gap: 12px;
    min-height: 250px;
  }

  .loading-wrapper {
    padding: 16px;
  }

  .ai-loading-progress {
    gap: 8px;
    max-width: 300px;
  }

  .ai-loading-progress .step {
    font-size: 12px;
  }

  .ai-loading-progress .circle {
    width: 20px;
    height: 20px;
  }

  .ai-flight-card {
    grid-template-columns: 1fr; /* Single column for small screens */
    grid-template-areas:
      "header"
      "main"
      "button"; /* Stack elements vertically */
    padding: 12px;
  }

  .flight-card-header {
    margin-bottom: 10px; /* Add back margin for spacing in column layout */
    padding-right: 0;
    justify-content: center; /* Center header content */
  }

  .badge {
    margin-left: 0; /* Reset margin for badges */
  }

  .flight-card-main {
    flex-direction: column; /* Stack flight info and details */
    align-items: center; /* Center horizontally */
    padding: 0;
  }

  .flight-info {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .arrow {
    transform: rotate(90deg);
  }

  .flight-details {
    flex-direction: column; /* Ensure details stack vertically */
    align-items: center; /* Center items in column for small screens */
    width: 100%;
    padding-left: 0;
  }

  .select-btn {
    width: 100%; /* Full width button on small screens */
    padding: 12px;
    font-size: 14px;
    margin-top: 10px; /* Add space above button */
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .modal-content h2 {
    font-size: 18px;
  }

  .ai-flight-card {
    padding: 10px;
  }

  .flight-time {
    font-size: 16px;
  }

  .airport {
    font-size: 14px;
  }

  .date {
    font-size: 12px;
  }
}

/* ai_results.css or other relevant CSS file */
.ai-insight .more-link {
    font-size: 0.9em; /* Adjust font size as needed */
    margin-left: 10px; /* Space from the text */
    text-decoration: underline; /* Add underline */
    color: #007bff; /* Example color, match your design */
    cursor: pointer;
}

.ai-insight .more-link:hover {
    color: #0056b3; /* Darker color on hover */
    text-decoration: none; /* Remove underline on hover, or keep it */
}
