/* AIDENTIT Chat Widget — Premium Web Theme */

.aic-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e89e3a 0%, #d68a2e 100%);
  box-shadow: 0 4px 20px rgba(232, 158, 58, 0.4);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.aic-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(232, 158, 58, 0.55);
}
.aic-fab svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s;
}
.aic-fab.aic-open svg {
  transform: rotate(90deg);
}
.aic-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(232, 158, 58, 0.5);
  animation: aic-pulse 2s ease-out infinite;
}
.aic-fab.aic-open .aic-fab-pulse {
  display: none;
}
@keyframes aic-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Panel */
.aic-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(520px, calc(100vh - 140px));
  background: rgba(12, 14, 23, 0.97);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(232, 158, 58, 0.2);
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', 'Open Sans', sans-serif;
  color: #e0e0e0;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s, transform 0.3s;
}
.aic-panel.aic-visible {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.aic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(232, 158, 58, 0.15);
  background: rgba(20, 22, 35, 0.6);
}
.aic-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e89e3a, #d68a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.aic-header-info {
  flex: 1;
  min-width: 0;
}
.aic-header-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.aic-header-status {
  display: block;
  font-size: 11px;
  color: #7fcf7f;
}
.aic-close {
  background: none;
  border: none;
  color: #888;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.aic-close:hover { color: #fff; }

/* Messages */
.aic-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 158, 58, 0.3) transparent;
}
.aic-messages::-webkit-scrollbar { width: 5px; }
.aic-messages::-webkit-scrollbar-thumb { background: rgba(232, 158, 58, 0.3); border-radius: 3px; }

.aic-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: aic-fadein 0.3s ease;
}
@keyframes aic-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.aic-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #e89e3a, #d68a2e);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.aic-msg-bot {
  align-self: flex-start;
  background: rgba(232, 158, 58, 0.08);
  border: 1px solid rgba(232, 158, 58, 0.12);
  border-bottom-left-radius: 4px;
}

/* Suggested questions */
.aic-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.aic-suggestion {
  background: rgba(232, 158, 58, 0.1);
  border: 1px solid rgba(232, 158, 58, 0.25);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  color: #e89e3a;
  cursor: pointer;
  transition: background 0.2s;
}
.aic-suggestion:hover {
  background: rgba(232, 158, 58, 0.2);
}

/* Loading dots */
.aic-loading {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.aic-dot {
  width: 8px;
  height: 8px;
  background: rgba(232, 158, 58, 0.5);
  border-radius: 50%;
  animation: aic-bounce 1.4s ease-in-out infinite;
}
.aic-dot:nth-child(2) { animation-delay: 0.16s; }
.aic-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes aic-bounce {
  0%, 80%, 100% { transform: scale(0.6); }
  40% { transform: scale(1); }
}

/* Input */
.aic-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(232, 158, 58, 0.15);
  background: rgba(20, 22, 35, 0.6);
}
.aic-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(232, 158, 58, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  color: #e0e0e0;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.aic-input:focus {
  border-color: rgba(232, 158, 58, 0.5);
}
.aic-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.aic-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e89e3a, #d68a2e);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.aic-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.aic-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Privacy notice */
.aic-privacy {
  text-align: center;
  padding: 6px 14px 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}
.aic-privacy a {
  color: rgba(232, 158, 58, 0.5);
  text-decoration: none;
}
.aic-privacy a:hover {
  color: #e89e3a;
}

/* ── Intro Card (inline section) ─────────────────────────────────────────── */
.aic-intro {
  text-align: center;
  margin-bottom: 24px;
}
.aic-intro-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #e89e3a 0%, #d68a2e 50%, #e89e3a 100%);
  box-shadow: 0 4px 24px rgba(232, 158, 58, 0.3);
}
.aic-intro-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}
.aic-intro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #e89e3a, #d68a2e);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  font-family: 'Poppins', sans-serif;
}
.aic-intro-name {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.2;
}
.aic-intro-role {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  color: #e89e3a;
  margin: 0 0 14px;
  font-weight: 500;
}
.aic-intro-desc {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 20px;
}
.aic-intro-meta {
  display: flex;
  justify-content: center;
  gap: 40px;
}
.aic-intro-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aic-intro-meta-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}
.aic-intro-meta-value {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.aic-intro-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* ── Inline mode ────────────────────────────────────────────────────────── */
.aic-inline .aic-panel {
  position: static;
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
  display: flex;
  opacity: 1;
  transform: none;
  border-radius: 16px;
}
/* Hide header in inline mode — intro card above replaces it */
.aic-inline .aic-header {
  display: none;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .aic-panel {
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
  }
  .aic-fab {
    bottom: 16px;
    right: 80px;
  }
  .aic-intro-name {
    font-size: 24px;
  }
  .aic-intro-meta {
    gap: 24px;
  }
}

/* ── Desktop FAB — avoids scroll-to-top arrow ───────────────────────────── */
@media (min-width: 769px) {
  .aic-fab {
    right: 90px;
  }
}
