/* ==============================================
   amenify-theme.css
   Design tokens + base styles for AmeBot UI
   Colors extracted directly from amenify.com
   ============================================== */

:root {
  /* Brand — exact blue from amenify.com buttons */
  --am-blue:         #1a6cf0;
  --am-blue-hover:   #1250c4;
  --am-blue-light:   #eef6ff;
  --am-blue-faint:   #f5f8ff;
  --am-blue-border:  #c0d8fa;

  /* Text */
  --am-text-primary: #0d0d0d;
  --am-text-body:    #2d2d2d;
  --am-text-muted:   #888888;
  --am-text-faint:   #aaaaaa;
  --am-text-white:   #ffffff;

  /* Surfaces */
  --am-bg:           #ffffff;
  --am-bg-page:      #f5f8ff;   /* very light blue — page background */
  --am-surface:      #ffffff;   /* cards, bubbles */
  --am-surface-alt:  #eef6ff;   /* bot bubble background */

  /* Borders */
  --am-border:       #e2e8f0;
  --am-border-blue:  #c0d8fa;

  /* Feedback */
  --am-error:        #d93025;
  --am-error-bg:     #fce8e6;
  --am-error-border: #f5c6c3;

  /* Announcement bar */
  --am-bar-bg:       #1a6cf0;
  --am-bar-text:     #ffffff;

  /* Radius */
  --am-radius-sm:    8px;
  --am-radius-md:    14px;
  --am-radius-lg:    20px;
  --am-radius-pill:  9999px;

  /* Shadows */
  --am-shadow-sm:    0 1px 4px rgba(26, 108, 240, 0.08);
  --am-shadow-md:    0 4px 16px rgba(26, 108, 240, 0.12);

  /* Font */
  --am-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Transitions */
  --am-transition: 160ms cubic-bezier(0.16, 1, 0.3, 1);
}


/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html   { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body   { font-family: var(--am-font); background: var(--am-bg-page); color: var(--am-text-body); line-height: 1.6; }
button { font-family: var(--am-font); cursor: pointer; border: none; background: none; }
a      { color: inherit; text-decoration: none; }
ul     { list-style: none; }


/* ── ANNOUNCEMENT BAR ───────────────────────── */
.am-bar {
  background: var(--am-bar-bg);
  color: var(--am-bar-text);
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.am-bar a { color: #cce3ff; text-decoration: underline; text-underline-offset: 2px; }


/* ── HEADER ─────────────────────────────────── */
.am-header {
  background: var(--am-bg);
  border-bottom: 1px solid var(--am-border);
  padding: 0 1.25rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: var(--am-shadow-sm);
}

.am-header-left  { display: flex; align-items: center; gap: 0.75rem; }
.am-header-right { display: flex; align-items: center; gap: 0.5rem; }

/* Logo pill — matches Amenify's blue */
.am-logo {
  width: 38px;
  height: 38px;
  background: var(--am-blue);
  border-radius: var(--am-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.am-logo svg { color: white; }

.am-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--am-text-primary);
  letter-spacing: -0.02em;
}

.am-brand-sub {
  font-size: 0.72rem;
  color: var(--am-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.05rem;
}

/* Online status dot */
.am-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: am-pulse 2s infinite;
}

@keyframes am-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}


/* ── ICON BUTTON (header actions) ───────────── */
.am-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--am-radius-sm);
  border: 1px solid var(--am-border);
  background: transparent;
  color: var(--am-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--am-transition), color var(--am-transition);
}
.am-icon-btn:hover {
  background: var(--am-blue-light);
  color: var(--am-blue);
  border-color: var(--am-blue-border);
}


/* ── CHAT WINDOW ────────────────────────────── */
.am-chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

/* Custom scrollbar — subtle blue tint */
.am-chat-window::-webkit-scrollbar       { width: 4px; }
.am-chat-window::-webkit-scrollbar-track { background: transparent; }
.am-chat-window::-webkit-scrollbar-thumb {
  background: var(--am-border-blue);
  border-radius: var(--am-radius-pill);
}


/* ── WELCOME SCREEN ─────────────────────────── */
.am-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  animation: am-fade-in 300ms ease;
}

.am-welcome-icon {
  width: 56px;
  height: 56px;
  background: var(--am-blue);
  border-radius: var(--am-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  box-shadow: var(--am-shadow-md);
}

.am-welcome-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--am-text-primary);
  letter-spacing: -0.02em;
}

.am-welcome-sub {
  font-size: 0.875rem;
  color: var(--am-text-muted);
  max-width: 28ch;
  line-height: 1.5;
}


/* ── SUGGESTION CHIPS ───────────────────────── */
/* Matches the pill button style on amenify.com */
.am-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.am-chip {
  padding: 0.4rem 1rem;
  border-radius: var(--am-radius-pill);
  border: 1.5px solid var(--am-blue-border);
  background: var(--am-bg);
  color: var(--am-blue);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--am-transition);
}
.am-chip:hover {
  background: var(--am-blue);
  color: var(--am-text-white);
  border-color: var(--am-blue);
  box-shadow: var(--am-shadow-sm);
}


/* ── MESSAGE ROW ─────────────────────────────── */
.am-message-row {
  display: flex;
  align-items: flex-end;
  gap: 0.625rem;
  animation: am-slide-in 200ms ease-out;
}
.am-message-row.user { flex-direction: row-reverse; }


/* Avatar */
.am-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.am-avatar-bot  { background: var(--am-blue);       color: white; }
.am-avatar-user {
  background: var(--am-blue-faint);
  color: var(--am-blue);
  border: 1.5px solid var(--am-blue-border);
}


/* ── MESSAGE BUBBLE ──────────────────────────── */
.am-bubble {
  max-width: min(72%, 480px);
  padding: 0.625rem 0.9375rem;
  font-size: 0.9rem;
  line-height: 1.6;
  word-break: break-word;
  border-radius: var(--am-radius-lg);
}

/* Bot bubble — white card with blue-tinted border (matches Amenify card style) */
.am-bubble-bot {
  background: var(--am-surface);
  border: 1px solid var(--am-border-blue);
  color: var(--am-text-body);
  border-bottom-left-radius: var(--am-radius-sm);
  box-shadow: var(--am-shadow-sm);
}

/* User bubble — solid Amenify blue (matches their primary CTA) */
.am-bubble-user {
  background: var(--am-blue);
  color: var(--am-text-white);
  border-bottom-right-radius: var(--am-radius-sm);
}

/* Error bubble */
.am-bubble-error {
  background: var(--am-error-bg);
  border: 1px solid var(--am-error-border);
  color: var(--am-error);
  border-radius: var(--am-radius-md);
  font-size: 0.875rem;
}


/* ── TYPING INDICATOR ────────────────────────── */
.am-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.75rem 1rem;
  background: var(--am-surface);
  border: 1px solid var(--am-border-blue);
  border-radius: var(--am-radius-lg);
  border-bottom-left-radius: var(--am-radius-sm);
  box-shadow: var(--am-shadow-sm);
  width: fit-content;
}

.am-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--am-blue-muted, #6aa3f8);
  animation: am-bounce 1.2s infinite;
}
.am-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.am-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes am-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}


/* ── INPUT AREA ──────────────────────────────── */
.am-input-area {
  background: var(--am-bg);
  border-top: 1px solid var(--am-border);
  padding: 0.875rem 1.25rem;
  flex-shrink: 0;
}

.am-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.625rem;
  max-width: 780px;
  margin: 0 auto;
}

.am-input {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--am-border);
  border-radius: var(--am-radius-md);
  padding: 0.65rem 0.9375rem;
  font-family: var(--am-font);
  font-size: 0.9375rem;
  color: var(--am-text-primary);
  background: var(--am-bg-page);
  outline: none;
  min-height: 46px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color var(--am-transition), box-shadow var(--am-transition);
}
.am-input::placeholder { color: var(--am-text-faint); }
.am-input:focus {
  border-color: var(--am-blue);
  background: var(--am-bg);
  box-shadow: 0 0 0 3px rgba(26, 108, 240, 0.1);
}
.am-input:disabled { opacity: 0.5; cursor: not-allowed; }


/* Send button — matches Amenify's solid blue buttons */
   blue pill CTA ────────────────────────────── */
.am-send-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--am-radius-md);
  background: var(--am-blue);
  color: var(--am-text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--am-transition),
              transform   var(--am-transition),
              box-shadow  var(--am-transition);
  box-shadow: var(--am-shadow-sm);
}
.am-send-btn:hover:not(:disabled) {
  background: var(--am-blue-hover);
  transform: translateY(-1px);
  box-shadow: var(--am-shadow-md);
}
.am-send-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.am-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* ── INPUT HINT ──────────────────────────────── */
/* "Press Enter to send · Shift+Enter for new line" */
.am-input-hint {
  font-size: 0.71rem;
  color: var(--am-text-faint);
  text-align: center;
  margin-top: 0.4rem;
  letter-spacing: 0.01em;
}

.am-input-hint kbd {
  font-family: var(--am-font);
  font-size: 0.68rem;
  background: var(--am-bg-page);
  color: var(--am-text-muted);
  border: 1px solid var(--am-border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  display: inline-block;
  line-height: 1.4;
}


/* ── ANIMATIONS ──────────────────────────────── */
@keyframes am-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

@keyframes am-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ── UTILITY ─────────────────────────────────── */
/* Use these directly in HTML when needed */
.am-text-blue    { color: var(--am-blue); }
.am-text-muted   { color: var(--am-text-muted); }
.am-text-error   { color: var(--am-error); }
.am-fw-bold      { font-weight: 700; }
.am-fw-semibold  { font-weight: 600; }
.am-sr-only {
  /* Screen reader only — hides visually but keeps it for accessibility */
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 480px) {
  .am-header        { padding: 0 1rem; height: 56px; }
  .am-brand-name    { font-size: 0.9rem; }
  .am-chat-window   { padding: 0.875rem; gap: 0.75rem; }
  .am-bubble        { max-width: 88%; font-size: 0.875rem; }
  .am-input-area    { padding: 0.75rem 1rem; }
  .am-input         { font-size: 0.9rem; }
  .am-send-btn      { width: 42px; height: 42px; }
  .am-chip          { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
  .am-welcome-title { font-size: 1rem; }
  .am-welcome-sub   { font-size: 0.8125rem; }
  .am-chips         { gap: 0.375rem; }
}