/* Comfy Tickets — AI Flight Assistant Widget Styles */

:root {
  --fc-ai-primary: #0284c7;
  --fc-ai-primary-hover: #0369a1;
  --fc-ai-primary-glow: rgba(2, 132, 199, 0.35);
  --fc-ai-accent: #f59e0b;
  --fc-ai-accent-hover: #d97706;
  --fc-ai-bg: #0f172a;
  --fc-ai-surface: #1e293b;
  --fc-ai-surface-alt: #334155;
  --fc-ai-border: rgba(255, 255, 255, 0.12);
  --fc-ai-text: #f8fafc;
  --fc-ai-muted: #94a3b8;
  --fc-ai-success: #10b981;
}

/* Floating Launcher Button (if not using the FAB bar) */
.fc-ai-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px var(--fc-ai-primary-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fc-ai-launcher:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.5);
}

.fc-ai-launcher svg {
  width: 28px;
  height: 28px;
}

/* AI Chat Drawer / Window */
.fc-ai-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 48px);
  background: var(--fc-ai-bg);
  border: 1px solid var(--fc-ai-border);
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fc-ai-widget.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.fc-ai-header {
  padding: 16px 20px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--fc-ai-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-ai-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fc-ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  position: relative;
}

.fc-ai-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fc-ai-success);
  border: 2px solid var(--fc-ai-bg);
}

.fc-ai-header-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--fc-ai-text);
  line-height: 1.2;
}

.fc-ai-header-info p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fc-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-ai-btn-icon {
  background: transparent;
  border: none;
  color: var(--fc-ai-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.fc-ai-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fc-ai-text);
}

/* AI Trust Banner */
.fc-ai-trust-banner {
  background: rgba(2, 132, 199, 0.1);
  border-bottom: 1px solid rgba(2, 132, 199, 0.2);
  padding: 8px 16px;
  font-size: 11px;
  color: #7dd3fc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-ai-trust-banner svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Chat Messages Container */
.fc-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.fc-ai-messages::-webkit-scrollbar {
  width: 6px;
}

.fc-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Message Bubbles */
.fc-ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: fcFadeIn 0.25s ease;
}

@keyframes fcFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.fc-ai-msg--user {
  align-self: flex-end;
}

.fc-ai-msg--user .fc-ai-msg-bubble {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.fc-ai-msg--assistant {
  align-self: flex-start;
}

.fc-ai-msg--assistant .fc-ai-msg-bubble {
  background: var(--fc-ai-surface);
  color: var(--fc-ai-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px 16px 16px 4px;
}

.fc-ai-msg-bubble {
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.fc-ai-msg-bubble p {
  margin: 0 0 8px 0;
}

.fc-ai-msg-bubble p:last-child {
  margin-bottom: 0;
}

.fc-ai-msg-bubble strong {
  color: #fff;
}

.fc-ai-msg-bubble ul {
  margin: 4px 0 6px 18px;
  padding: 0;
}

.fc-ai-msg-time {
  font-size: 10px;
  color: var(--fc-ai-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.fc-ai-msg--user .fc-ai-msg-time {
  text-align: right;
}

/* Flight Offer Card Component */
.fc-ai-flight-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.fc-ai-flight-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.fc-ai-flight-card:hover {
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.fc-ai-flight-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.fc-ai-airline-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-ai-cabin-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.fc-ai-flight-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fc-ai-flight-point {
  text-align: left;
}

.fc-ai-flight-point.is-dest {
  text-align: right;
}

.fc-ai-flight-time {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.fc-ai-flight-code {
  font-size: 12px;
  color: var(--fc-ai-muted);
  font-weight: 600;
}

.fc-ai-flight-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px;
}

.fc-ai-flight-dur {
  font-size: 10.5px;
  color: var(--fc-ai-muted);
  margin-bottom: 3px;
}

.fc-ai-flight-line {
  width: 60px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
}

.fc-ai-flight-line::after {
  content: '✈';
  position: absolute;
  top: -8px;
  left: calc(50% - 6px);
  font-size: 10px;
  color: #38bdf8;
}

.fc-ai-flight-stops {
  font-size: 10px;
  color: #f59e0b;
  margin-top: 3px;
}

.fc-ai-flight-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
  padding: 8px 10px;
  border-radius: 10px;
}

.fc-ai-flight-price-box {
  display: flex;
  flex-direction: column;
}

.fc-ai-flight-price-label {
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--fc-ai-muted);
}

.fc-ai-flight-price-val {
  font-size: 16px;
  font-weight: 800;
  color: #10b981;
}

.fc-ai-flight-select-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-ai-flight-select-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: scale(1.03);
}

/* In-Chat Lead Form */
.fc-ai-lead-form {
  background: #1e293b;
  border: 1px solid #38bdf8;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fc-ai-lead-form h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.fc-ai-lead-form p {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: var(--fc-ai-muted);
}

.fc-ai-form-group {
  margin-bottom: 10px;
}

.fc-ai-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.fc-ai-form-input {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

.fc-ai-form-input:focus {
  border-color: #38bdf8;
}

.fc-ai-lead-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.15s ease;
}

.fc-ai-lead-submit-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Quick Prompts */
.fc-ai-quick-prompts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 16px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fc-ai-quick-prompts::-webkit-scrollbar {
  display: none;
}

.fc-ai-quick-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.fc-ai-quick-btn:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

/* Input Area */
.fc-ai-input-bar {
  padding: 12px 16px;
  background: #1e293b;
  border-top: 1px solid var(--fc-ai-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.fc-ai-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

.fc-ai-input:focus {
  border-color: #38bdf8;
}

.fc-ai-input::placeholder {
  color: var(--fc-ai-muted);
}

.fc-ai-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.fc-ai-send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.fc-ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing Indicator */
.fc-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--fc-ai-surface);
  border-radius: 14px;
  width: fit-content;
}

.fc-ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  animation: fcBounce 1.4s infinite ease-in-out both;
}

.fc-ai-dot:nth-child(1) { animation-delay: -0.32s; }
.fc-ai-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes fcBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .fc-ai-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
}
