/* ===== Global Styles ===== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f3f6fa;
  margin: 0;
  padding: 0;
  color: #333;
}

/* ===== Floating Bot Icon ===== */
#flightBotIcon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007BFF;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  cursor: pointer;
  z-index: 2000;
  transition: transform 0.2s ease;
}
#flightBotIcon:hover { 
  transform: scale(1.06); 
}

/* ===== Chat Popup (hidden by default) ===== */
.chat-popup {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 420px;
  max-width: calc(100% - 40px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1999;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.chat-popup.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  background: linear-gradient(135deg, #007BFF, #0056b3);
  padding: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header .title { 
  flex: 1; 
  text-align: center; 
}
.chat-header .close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  margin-left: 8px;
}

/* ===== Small clue bar ===== */
.booking-clue {
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: #555;
  background: #f8f9fa;
}

/* ===== Chat box area ===== */
.chat-box {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #eef1f6;
  max-height: 440px;
}

/* Single messages */
.message {
  max-width: 85%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  clear: both;
}
.message.ai {
  background-color: #e8ebf1;
  color: #000;
  float: left;
  border-bottom-left-radius: 6px;
}
.message.user {
  background-color: #007BFF;
  color: #fff;
  float: right;
  border-bottom-right-radius: 6px;
}

/* ===== Input area ===== */
.input-container {
  display: flex;
  border-top: 1px solid #ddd;
  padding: 8px;
  background: #fff;
}
.input-container input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color 0.3s;
}
.input-container input:focus { 
  border-color: #007BFF; 
  outline: none; 
}
.input-container button {
  border: none;
  background: linear-gradient(135deg, #007BFF, #0056b3);
  color: #fff;
  padding: 8px 14px;
  margin-left: 8px;
  border-radius: 25px;
  cursor: pointer;
}

/* ===== Suggestion Buttons ===== */
.suggestion-container {
  margin: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.suggestion-btn {
  background-color: #f0f2f5;
  border: none;
  border-radius: 15px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

/* ===== Cards & carousel (used for results) ===== */
.carousel-container { 
  position: relative; 
  width: 100%; 
  padding: 6px 0; 
}
.card-container {
  width: 100%;
  display: flex;
  gap: 16px;
  padding: 10px 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
}
.card {
  flex: 0 0 320px;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  text-align: left;
}
.card h3 { 
  margin: 6px 0; 
}
.airline-logo { 
  width: 48px; 
  height: auto; 
  margin-bottom: 8px; 
  float: right; 
}
.book-btn { 
  display: inline-block; 
  margin-top: 10px; 
  padding: 8px 12px; 
  border-radius: 20px; 
  text-decoration: none; 
  color: #fff; 
  background: #007BFF; 
}

/* Navigation arrows */
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.08);
  color: #007BFF;
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.nav.left { 
  left: 8px; 
}
.nav.right { 
  right: 8px; 
}

/* pulse animation for cheapest */
@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 6px 18px rgba(0,0,0,0.06); 
  }
  50% { 
    transform: scale(1.03); 
    box-shadow: 0 10px 26px rgba(0,0,0,0.12); 
  }
}
.card.cheapest {
  animation: pulse 2s infinite;
  border: 2px solid gold;
}
.card.direct {
  border: 2px solid #28a745; /* green for direct flights */
}

/* Filters */
.filter-btn {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 6px 10px;
  margin: 6px 6px 0 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
}

/* Booking confirmation page styles */
.booking-container {
  max-width: 900px;
  margin: auto;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.booking-container h2 { 
  margin-top: 0; 
}
.booking-details { 
  margin-bottom: 20px; 
}
.booking-details img { 
  max-width: 100px; 
}
.confirm-btn {
  background: #007BFF;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
}
.confirm-btn:hover { 
  background: #0056b3; 
}

/* ===== Responsive Enhancements ===== */
@media (max-width: 768px) {
  .chat-popup {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 80px;
    max-height: 80vh;
  }
  .card {
    flex: 0 0 240px;
    padding: 10px;
  }
  .chat-box {
    max-height: calc(80vh - 120px);
    padding: 10px;
  }
  .suggestion-btn {
    font-size: 11px;
    padding: 5px 10px;
  }
  .booking-clue {
    font-size: 12px;
    padding: 6px;
  }
}

@media (max-width: 480px) {
  #flightBotIcon {
    width: 50px;
    height: 50px;
    font-size: 22px;
    right: 12px;
    bottom: 12px;
  }
  .chat-popup {
    left: 5px;
    right: 5px;
    bottom: 70px;
    border-radius: 12px;
  }
  .chat-header {
    font-size: 14px;
    padding: 10px;
  }
  .message {
    font-size: 13px;
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  .input-container {
    flex-direction: column;
    gap: 6px;
  }
  .input-container input {
    font-size: 13px;
    padding: 7px 10px;
    width: 100%;
  }
  .input-container button {
    width: 100%;
    font-size: 13px;
    padding: 7px;
  }
  .card {
    flex: 0 0 200px;
    padding: 8px;
  }
  .card h3 {
    font-size: 14px;
  }
  .nav {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}
