/* ==========================================================
   AIRA PRESS CLUB — Guided Interactive Helpdesk Chatbot Styles
   ========================================================== */

.aira-chat-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ─── Floating Launcher Button ──────────────────────────── */
.aira-chat-launcher {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  border: 2px solid #d97706; /* Royal Gold Accent */
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.45), 0 4px 12px rgba(217, 119, 6, 0.25);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  outline: none;
  padding: 0;
}

.aira-chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.55), 0 6px 16px rgba(217, 119, 6, 0.4);
}

.aira-chat-launcher:active {
  transform: scale(0.96);
}

.chat-launcher-icon {
  font-size: 26px;
  line-height: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-launcher-close {
  display: none;
  font-size: 30px;
  line-height: 1;
  font-weight: 300;
}

.aira-chat-widget.is-open .chat-launcher-icon {
  display: none;
}

.aira-chat-widget.is-open .chat-launcher-close {
  display: block;
}

/* Tooltip on hover */
.chat-launcher-tooltip {
  position: absolute;
  right: 68px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.chat-launcher-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
  border-width: 5px 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent transparent #0f172a;
}

.aira-chat-launcher:hover .chat-launcher-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.aira-chat-widget.is-open .chat-launcher-tooltip {
  display: none !important;
}

/* ─── Chat Window ───────────────────────────────────────── */
.aira-chat-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 375px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 100px);
  background: #f8fafc;
  border-radius: 18px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.25s;
}

.aira-chat-widget.is-open .aira-chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ─── Chat Header ───────────────────────────────────────── */
.aira-chat-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #d97706; /* Royal Gold */
  flex-shrink: 0;
}

.aira-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aira-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
}

.aira-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  border: 1.5px solid #d97706;
  object-fit: contain;
}

.aira-online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #0f172a;
  border-radius: 50%;
}

.aira-chat-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.aira-chat-status {
  font-size: 0.72rem;
  color: #86efac;
  display: block;
  margin-top: 2px;
}

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

.chat-btn-header {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
  transition: background 0.15s ease;
  line-height: 1;
}

.chat-btn-header:hover {
  background: rgba(255, 255, 255, 0.24);
}

.chat-btn-header.chat-close-x {
  font-size: 1.2rem;
  padding: 3px 8px;
}

/* ─── Messages Body ─────────────────────────────────────── */
.aira-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.aira-chat-body::-webkit-scrollbar {
  width: 5px;
}
.aira-chat-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Bubble Styles */
.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.chat-msg-row.from-bot {
  align-self: flex-start;
}

.chat-msg-row.from-user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}

.from-bot .chat-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 14px 14px 14px 3px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.from-user .chat-bubble {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: 14px 14px 3px 14px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.chat-time {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 3px;
  display: block;
}
.from-user .chat-time {
  text-align: right;
}

/* ─── Quick Actions / Options Grid ──────────────────────── */
.chat-options-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}

.chat-opt-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  width: 100%;
}

.chat-opt-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateX(4px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.chat-opt-btn:active {
  transform: translateX(2px) scale(0.99);
}

.chat-opt-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Action Link Inside Bot Bubble */
.chat-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: #1e3a8a;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
  transition: background 0.18s ease;
}

.chat-action-link:hover {
  background: #0f172a;
}

.chat-action-link.whatsapp-link {
  background: #16a34a;
}
.chat-action-link.whatsapp-link:hover {
  background: #15803d;
}

/* Status Result Card */
.chat-status-card {
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.82rem;
}

.chat-status-card.status-approved {
  border-color: #86efac;
  background: #f0fdf4;
}

.chat-status-card.status-pending {
  border-color: #fde047;
  background: #fefce8;
}

.chat-status-card.status-rejected {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* ─── Footer Input Bar ──────────────────────────────────── */
.aira-chat-footer {
  background: #ffffff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.chat-quick-menu-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.chat-quick-menu-btn:hover {
  background: #e2e8f0;
}

.aira-chat-input {
  flex: 1;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 22px;
  padding: 8px 14px;
  font-size: 0.84rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
  min-width: 0;
}

.aira-chat-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.aira-chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.aira-chat-send-btn:hover {
  transform: scale(1.06);
}

.aira-chat-send-btn:active {
  transform: scale(0.94);
}

/* ─── Mobile Responsiveness ─────────────────────────────── */
@media (max-width: 480px) {
  .aira-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .aira-chat-launcher {
    width: 52px;
    height: 52px;
  }

  .chat-launcher-icon {
    font-size: 24px;
  }

  .aira-chat-window {
    width: calc(100vw - 24px);
    right: -6px;
    bottom: 64px;
    height: calc(100vh - 110px);
    max-height: 520px;
    border-radius: 16px;
  }

  .chat-bubble {
    font-size: 0.84rem;
  }

  .chat-opt-btn {
    font-size: 0.8rem;
    padding: 7px 10px;
  }
}
