/* ============================================================
   ARA — TeckGenie Website AI Assistant widget
   Reuses the site's existing design tokens from style.css
   ============================================================ */

.ara-launcher {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 950;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue-500), var(--green-500));
  box-shadow: 0 10px 26px rgba(17, 137, 196, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ara-launcher:hover { transform: scale(1.06); box-shadow: 0 14px 32px rgba(17, 137, 196, 0.48); }
.ara-launcher .ara-launcher-icon-close { display: none; }
.ara-launcher.ara-open .ara-launcher-icon-chat { display: none; }
.ara-launcher.ara-open .ara-launcher-icon-close { display: flex; }
.ara-launcher-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-400);
  border: 2px solid #fff;
}
.ara-launcher.ara-open .ara-launcher-badge { display: none; }

.ara-panel {
  position: fixed;
  right: 26px;
  bottom: 100px;
  z-index: 940;
  width: min(380px, calc(100vw - 40px));
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.ara-panel.ara-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ara-header {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, #0d3a52 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ara-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-500), var(--green-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.ara-header-text { flex: 1; min-width: 0; }
.ara-header-text strong { display: block; font-family: "Poppins", sans-serif; font-size: 0.98rem; }
.ara-header-status { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: #a9c3cd; }
.ara-header-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-400); box-shadow: 0 0 0 3px rgba(111,190,68,0.25); }
.ara-header-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ara-header-close:hover { background: rgba(255,255,255,0.16); }

.ara-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--gray-100);
}
.ara-msg { display: flex; gap: 8px; max-width: 88%; }
.ara-msg-bot { align-self: flex-start; }
.ara-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.ara-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: #fff;
  margin-top: 2px;
}
.ara-msg-bot .ara-msg-avatar { background: linear-gradient(135deg, var(--blue-500), var(--navy-700)); }
.ara-msg-user .ara-msg-avatar { background: linear-gradient(135deg, var(--green-500), var(--green-600)); }
.ara-msg-bubble {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.ara-msg-bot .ara-msg-bubble { background: #fff; border: 1px solid var(--gray-200); color: var(--gray-900); border-top-left-radius: 4px; }
.ara-msg-user .ara-msg-bubble { background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); color: #fff; border-top-right-radius: 4px; }

.ara-typing { align-self: flex-start; display: flex; gap: 8px; }
.ara-typing-bubble {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  border-top-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.ara-typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: ara-bounce 1.2s infinite ease-in-out;
}
.ara-typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.ara-typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ara-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ara-input-row {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--gray-200);
  background: #fff;
}
.ara-input-row textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  max-height: 90px;
  line-height: 1.4;
  color: var(--gray-900);
}
.ara-input-row textarea:focus { outline: none; border-color: var(--blue-500); }
.ara-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--blue-500), var(--green-500));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.ara-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ara-footnote {
  text-align: center;
  font-size: 0.68rem;
  color: var(--gray-400);
  padding: 6px 14px 12px;
  background: #fff;
}

@media (max-width: 480px) {
  .ara-panel {
    right: 14px;
    left: 14px;
    bottom: 92px;
    width: auto;
    max-width: none;
    height: calc(100vh - 130px);
  }
  .ara-launcher { right: 18px; bottom: 18px; }
}
