/* Premium AI Chatbot - Native & Integrated */
.chatbot-toggle {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 55px;
  height: 55px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #0d3956;
  padding: 0;
  overflow: hidden;
  animation: chatbot-pulse 2s infinite;
}

.chatbot-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(13, 57, 86, 0.2);
}

.chatbot-container {
  position: fixed;
  bottom: 160px;
  right: 25px;
  width: 350px;
  max-height: calc(100vh - 180px);
  /* Ensure it fits in viewport */
  height: 500px;
  /* Preferred height */
  background: #ffffff;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  z-index: 2001;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.chatbot-container.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chatbot-header {
  background: #0d3956;
  color: white;
  padding: 12px 18px;
  /* More compact header */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: white;
  padding: 2px;
}

.chatbot-header h5 {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.status-online {
  font-size: 0.65rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-online::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.7;
}

.chatbot-messages {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.chatbot-message {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.chatbot-message.bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: #334155;
  border-bottom-left-radius: 2px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bot-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-top: 1px;
}

.chatbot-message.user {
  align-self: flex-end;
  background: #0d3956;
  color: white;
  border-bottom-right-radius: 2px;
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-left: 30px;
}

.suggestion-btn {
  background: #fff;
  border: 1px solid #0d3956;
  color: #0d3956;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-btn:hover {
  background: #0d3956;
  color: #fff;
}

.chatbot-input {
  padding: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
}

.chatbot-input input {
  flex-grow: 1;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 15px;
  outline: none;
  font-size: 0.85rem;
}

.chatbot-input input:focus {
  border-color: #0d3956;
}

.chatbot-send {
  background: #0d3956;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* --- Bot Rich Card Styles --- */
.chatbot-message.bot-card {
  max-width: 90%;
  padding: 0;
  background: transparent;
  flex-direction: column;
  gap: 5px;
}

.chatbot-message.bot-card .bot-msg-avatar {
  margin-left: 12px;
}

.visa-card-content {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  width: 100%;
  margin-top: 4px;
}

.visa-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
}

.visa-card-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visa-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(13, 57, 86, 0.9) 0%, rgba(13, 57, 86, 0) 100%);
  padding: 20px 12px 8px;
  color: white;
}

.visa-card-overlay h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.visa-card-req-list {
  padding: 12px;
  font-size: 0.85rem;
  color: #334155;
}

.req-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #0d3956;
}

.req-text {
  line-height: 1.4;
}

.visa-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.card-btn-download,
.card-btn-book {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.card-btn-download {
  background: #f1f5f9;
  color: #0d3956;
  border: 1px solid #cbd5e1;
}

.card-btn-download:hover {
  background: #e2e8f0;
  color: #0d3956;
}

.card-btn-book {
  background: #0d3956;
  color: white;
}

.card-btn-book:hover {
  background: #1e4b6b;
}

.chatbot-inline-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-btn-inline {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
}

.whatsapp-btn-inline {
  background: #25D366 !important;
  color: white !important;
}

.whatsapp-btn-inline:hover {
  background: #1da851 !important;
}

.query-btn-inline {
  background: #0f172a !important;
  color: white !important;
}

.query-btn-inline:hover {
  background: #1e293b !important;
}

@media (max-width: 480px) {
  .chatbot-label {
    display: none;
  }
  
  .chatbot-container {
    right: 10px;
    bottom: 80px !important;
    width: calc(100vw - 20px) !important;
    height: 75vh !important;
    max-height: 550px;
    border-radius: 12px !important;
  }

  .chatbot-toggle {
    bottom: 15px;
    right: 15px;
  }

  .chatbot-messages {
    overflow-x: hidden;
    flex: 1;
  }

  .chatbot-message {
    max-width: 78%;
  }

  .chatbot-message.user {
    white-space: nowrap;
    min-width: unset;
    max-width: 75%;
  }

  .message-content {
    max-width: calc(100% - 46px) !important;
    word-break: break-word;
  }

  .visa-card-content {
    max-width: calc(100% - 46px) !important;
  }

  .chatbot-inline-buttons {
    flex-wrap: wrap;
  }

  .chat-btn-inline {
    flex: 1 1 calc(50% - 4px);
    min-width: 100px;
    font-size: 0.73rem;
    padding: 8px 5px;
  }

  .visa-card-actions {
    flex-wrap: wrap;
  }

  .card-btn-download,
  .card-btn-book {
    flex: 1 1 calc(50% - 4px);
    font-size: 0.73rem;
    padding: 7px 5px;
  }
}

/* Chatbot Query Modal Style Overrides for Welcome Page Conflict */
#chatbotQueryModal .modal-body {
  background-color: #ffffff !important;
}

#chatbotQueryModal .form-control,
#chatbotQueryModal .form-select,
#chatbotQueryModal textarea {
  background-color: #fff !important;
  border: 1px solid #ced4da !important;
  color: #333 !important;
  padding: 8px 12px !important;
  font-size: 0.88rem !important;
}

#chatbotQueryModal .form-control:focus,
#chatbotQueryModal .form-select:focus,
#chatbotQueryModal textarea:focus {
  background-color: #fff !important;
  border-color: #0d3956 !important;
  color: #333 !important;
  box-shadow: 0 0 0 0.2rem rgba(13, 57, 86, 0.25) !important;
}

#chatbotQueryModal .form-label {
  color: #4b5563 !important;
  margin-bottom: 4px !important;
}

/* Specific dropdown arrow for select elements */
#chatbotQueryModal .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-size: 12px !important;
}

/* Bubbling/Pulse Animation for Chatbot */
@keyframes chatbot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 57, 86, 0.4);
    transform: scale(1);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(13, 57, 86, 0);
    transform: scale(1.05);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(13, 57, 86, 0);
    transform: scale(1);
  }
}

/* Discreet Live Chat Label */
.chatbot-label {
  position: fixed;
  bottom: 108px;
  right: 88px;
  background: #0d3956;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 1999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: chatbot-label-fade 0.5s ease-out;
}

.chatbot-label::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 6px solid #0d3956;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

@keyframes chatbot-label-fade {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hide label when chat is open */
.chatbot-container.active~.chatbot-label {
  display: none;
}