/* ============================================================
   SHAZIA ACADEMY — AI CHATBOT STYLES
   Matches site theme: Navy #0B1440 + Mustard #D98C0F
   Fonts: Fraunces (headings) / Plus Jakarta Sans (body)
   NOTE: If your site already loads these Google Fonts globally,
   you can remove the @import below to avoid loading them twice.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  --sz-navy: #0B1440;
  --sz-navy-light: #16215c;
  --sz-mustard: #D98C0F;
  --sz-mustard-light: #f0a832;
  --sz-white: #ffffff;
  --sz-bg-soft: #f4f5fa;
  --sz-text-dark: #1a1a2e;
  --sz-radius-lg: 20px;
  --sz-radius-md: 14px;
  --sz-radius-sm: 10px;
  --sz-shadow: 0 12px 40px rgba(11, 20, 64, 0.25);
  --sz-shadow-soft: 0 4px 14px rgba(11, 20, 64, 0.15);
  --sz-font-heading: 'Fraunces', serif;
  --sz-font-body: 'Plus Jakarta Sans', sans-serif;
}

/* ---------- Floating Button ---------- */
#sz-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sz-navy), var(--sz-navy-light));
  border: 2px solid var(--sz-mustard);
  box-shadow: var(--sz-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  animation: sz-entrance 0.6s ease-out;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#sz-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 46px rgba(217, 140, 15, 0.35);
}
#sz-chat-toggle svg { width: 28px; height: 28px; fill: var(--sz-mustard); }
#sz-chat-toggle.sz-bounce-once { animation: sz-entrance 0.6s ease-out, sz-bounce 0.9s ease 0.6s 1; }

@keyframes sz-entrance {
  from { opacity: 0; transform: translateY(30px) scale(0.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sz-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-5px); }
}

/* Unread badge */
#sz-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--sz-mustard);
  color: var(--sz-navy);
  font-family: var(--sz-font-body);
  font-weight: 700;
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--sz-white);
}
#sz-chat-badge.sz-hidden { display: none; }

/* ---------- Chat Window ---------- */
#sz-chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(217, 140, 15, 0.25);
  border-radius: var(--sz-radius-lg);
  box-shadow: var(--sz-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: var(--sz-font-body);
  transform-origin: bottom right;
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
#sz-chat-window.sz-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
#sz-chat-window.sz-minimized { height: 64px; }

/* Header */
.sz-chat-header {
  background: linear-gradient(120deg, var(--sz-navy), var(--sz-navy-light));
  color: var(--sz-white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sz-chat-header .sz-ai-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sz-mustard);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sz-chat-header .sz-ai-icon svg { width: 20px; height: 20px; fill: var(--sz-navy); }
.sz-chat-header .sz-header-text { flex: 1; min-width: 0; }
.sz-chat-header .sz-header-text h4 {
  font-family: var(--sz-font-heading);
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sz-chat-header .sz-status {
  font-size: 11px;
  color: var(--sz-mustard-light);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sz-chat-header .sz-status .sz-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  display: inline-block;
  box-shadow: 0 0 6px #3ddc84;
}
.sz-header-actions { display: flex; gap: 6px; }
.sz-header-actions button {
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--sz-white);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.sz-header-actions button:hover { background: var(--sz-mustard); }
.sz-header-actions svg { width: 15px; height: 15px; fill: var(--sz-white); }

/* Body */
.sz-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--sz-bg-soft);
}
.sz-chat-body::-webkit-scrollbar { width: 5px; }
.sz-chat-body::-webkit-scrollbar-thumb { background: rgba(217,140,15,0.4); border-radius: 10px; }

.sz-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--sz-radius-md);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: var(--sz-shadow-soft);
  animation: sz-fade-in 0.25s ease;
}
@keyframes sz-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sz-msg.sz-bot {
  align-self: flex-start;
  background: var(--sz-white);
  color: var(--sz-text-dark);
  border-bottom-left-radius: 4px;
}
.sz-msg.sz-user {
  align-self: flex-end;
  background: linear-gradient(120deg, var(--sz-navy), var(--sz-navy-light));
  color: var(--sz-white);
  border-bottom-right-radius: 4px;
}
.sz-msg-time {
  font-size: 9.5px;
  opacity: 0.55;
  margin-top: 4px;
  display: block;
}

/* Typing indicator */
.sz-typing {
  align-self: flex-start;
  background: var(--sz-white);
  border-radius: var(--sz-radius-md);
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  box-shadow: var(--sz-shadow-soft);
}
.sz-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sz-mustard);
  animation: sz-typing-bounce 1.1s infinite ease-in-out;
}
.sz-typing span:nth-child(2) { animation-delay: 0.15s; }
.sz-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sz-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick reply chips */
.sz-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.sz-chip {
  font-family: var(--sz-font-body);
  font-size: 12px;
  font-weight: 600;
  background: var(--sz-white);
  color: var(--sz-navy);
  border: 1.5px solid var(--sz-mustard);
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sz-chip:hover {
  background: var(--sz-mustard);
  color: var(--sz-white);
  transform: translateY(-2px);
}

/* Footer / input */
.sz-chat-footer {
  border-top: 1px solid rgba(11,20,64,0.08);
  background: var(--sz-white);
  padding: 10px 12px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.sz-chat-footer textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid rgba(11,20,64,0.15);
  border-radius: var(--sz-radius-sm);
  padding: 9px 12px;
  font-family: var(--sz-font-body);
  font-size: 13px;
  max-height: 80px;
  outline: none;
  transition: border-color 0.2s ease;
}
.sz-chat-footer textarea:focus { border-color: var(--sz-mustard); }
.sz-chat-footer button.sz-send-btn {
  background: var(--sz-mustard);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}
.sz-chat-footer button.sz-send-btn:hover { background: var(--sz-navy); transform: scale(1.06); }
.sz-chat-footer button.sz-send-btn svg { width: 16px; height: 16px; fill: var(--sz-white); }

/* Mute toggle small link under footer */
.sz-mute-row {
  text-align: center;
  font-size: 10.5px;
  color: rgba(11,20,64,0.5);
  padding: 3px 0 8px;
  background: var(--sz-white);
  cursor: pointer;
  user-select: none;
}
.sz-mute-row:hover { color: var(--sz-mustard); }

/* Responsive */
@media (max-width: 480px) {
  #sz-chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
    height: calc(100vh - 120px);
  }
  #sz-chat-toggle { bottom: 16px; right: 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #sz-chat-toggle, #sz-chat-window, .sz-msg, .sz-typing span { animation: none !important; transition: none !important; }
}
