/* ═══ ARIA Chat Panel ═══════════════════════════════════════════════════════ */

/* Toggle button — floating bottom-right */
.aria-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #4A90B8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(74, 144, 184, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 1000;
}
.aria-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(74, 144, 184, 0.4);
}
.aria-toggle.hidden { display: none; }
.aria-toggle svg { stroke: white; }

/* Panel — slides up from bottom-right */
.aria-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  height: 520px;
  background: #F7F9FB;
  border-radius: 14px;
  border: 1px solid #D4DEE6;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  pointer-events: none;
}
.aria-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.aria-header {
  background: #EEF4F8;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #D4DEE6;
  flex-shrink: 0;
}
.aria-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
}
.aria-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #4A90B8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aria-title {
  font-weight: 600;
  font-size: 13.5px;
  color: #1a1a1a;
  letter-spacing: -0.2px;
}
.aria-subtitle {
  font-size: 10.5px;
  color: #6b7280;
}
.aria-minimize {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #6b7280;
  display: flex;
  align-items: center;
}
.aria-minimize:hover { background: rgba(0,0,0,0.05); }

/* Messages area */
.aria-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aria-messages::-webkit-scrollbar { width: 4px; }
.aria-messages::-webkit-scrollbar-thumb { background: #D4DEE6; border-radius: 2px; }

/* Message row */
.aria-msg { display: flex; gap: 8px; align-items: flex-start; }
.aria-msg-user { justify-content: flex-end; }

/* Avatar */
.aria-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #4A90B8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Bubbles */
.aria-bubble {
  padding: 9px 13px;
  font-size: 12.5px;
  line-height: 1.6;
  max-width: 82%;
  word-wrap: break-word;
}
.aria-bubble-assistant {
  background: white;
  border: 1px solid #e5e5e0;
  border-radius: 2px 10px 10px 10px;
  color: #1a1a1a;
}
.aria-bubble-user {
  background: #4A90B8;
  color: white;
  border-radius: 10px 2px 10px 10px;
}
.aria-bubble strong { font-weight: 600; }
.aria-bubble-assistant strong { color: #4A90B8; }

/* Typing indicator */
.aria-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.aria-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4A90B8;
  animation: ariaDot 1.4s ease-in-out infinite;
}
.aria-typing span:nth-child(2) { animation-delay: 0.2s; }
.aria-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ariaDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Suggested questions */
.aria-suggestions {
  padding: 0 14px 8px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.aria-chip {
  font-size: 10.5px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 12px;
  background: white;
  border: 1px solid #D4DEE6;
  color: #4A90B8;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.1s, border-color 0.1s;
}
.aria-chip:hover {
  background: #EEF4F8;
  border-color: #4A90B8;
}

/* Input bar */
.aria-input-bar {
  padding: 8px 10px;
  border-top: 1px solid #e5e5e0;
  background: white;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.aria-input {
  flex: 1;
  font-size: 12.5px;
  font-family: inherit;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid #e5e5e0;
  background: #F7F9FB;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s;
}
.aria-input:focus { border-color: #4A90B8; }
.aria-input:disabled { opacity: 0.6; }
.aria-input::placeholder { color: #9ca3af; }

.aria-send {
  width: 33px;
  height: 33px;
  border-radius: 8px;
  background: #E87722;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.aria-send:hover { background: #c46218; }
.aria-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Export bar — below each assistant message */
.aria-export-bar {
  display: flex;
  gap: 6px;
  margin: 4px 0 0 0;
  padding: 0 2px;
}

.aria-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid #d5dbe0;
  border-radius: 4px;
  background: #f7f8f9;
  color: #6c7a89;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.aria-export-btn:hover {
  background: #eef1f4;
  border-color: #4A90B8;
  color: #4A90B8;
}

.aria-export-btn svg {
  flex-shrink: 0;
}

/* Tables inside chat bubbles */
.aria-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 11px;
}
.aria-table th {
  background: #EEF4F8;
  font-weight: 600;
  color: #2C3E50;
  text-align: left;
  padding: 5px 8px;
  border-bottom: 2px solid #D4DEE6;
}
.aria-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  color: #1a1a1a;
}
.aria-table tr:nth-child(even) td {
  background: #F7F9FB;
}

/* Section headers in chat bubbles */
.aria-section-header {
  font-weight: 600;
  font-size: 12px;
  color: #2C3E50;
  margin: 8px 0 4px 0;
  padding-bottom: 2px;
  border-bottom: 1px solid #E8EEF3;
}
