/* ================================================================
   Sankalp Bot — Chat widget styles
   Color palette inherits school brand: maroon #7B1C2E, gold #D4A017
   ================================================================ */

/* ── Floating trigger button ── */
.sbot-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B1C2E, #A8364A);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(123,28,46,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 9990;
  transition: transform 0.2s, box-shadow 0.2s;
}
.sbot-btn:hover  { transform: scale(1.08); box-shadow: 0 6px 28px rgba(123,28,46,0.55); }
.sbot-btn:focus  { outline: 3px solid #D4A017; outline-offset: 3px; }

/* Pulse dot — shows when bot wants attention */
.sbot-notif {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  background: #D4A017;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
  animation: sbotPulse 1.4s ease-in-out infinite;
}
@keyframes sbotPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.75; }
}

/* ── Chat window ── */
.sbot-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 340px;
  max-height: 500px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  z-index: 9989;
  overflow: hidden;
  /* Hidden state */
  transform: scale(0.85) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}
.sbot-window.sbot--open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
.sbot-header {
  background: linear-gradient(135deg, #7B1C2E, #A8364A);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.sbot-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.sbot-header__info   { flex: 1; min-width: 0; }
.sbot-header__name   { font-weight: 700; font-size: 1rem; font-family: 'Playfair Display', serif; }
.sbot-header__status { font-size: 0.73rem; opacity: 0.82; margin-top: 1px; }

.sbot-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.sbot-close:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* ── Messages area ── */
.sbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F8F4F1;
  scroll-behavior: smooth;
}
.sbot-messages::-webkit-scrollbar        { width: 4px; }
.sbot-messages::-webkit-scrollbar-track  { background: transparent; }
.sbot-messages::-webkit-scrollbar-thumb  { background: #D4C4BC; border-radius: 4px; }

/* Individual message bubbles */
.sbot-msg {
  max-width: 84%;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  animation: sbotFadeIn 0.3s ease forwards;
  word-break: break-word;
}
@keyframes sbotFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sbot-msg--bot {
  background: #fff;
  color: #2D2D2D;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  align-self: flex-start;
  white-space: pre-line;
}
.sbot-msg--user {
  background: linear-gradient(135deg, #7B1C2E, #A8364A);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  align-self: flex-end;
}
.sbot-msg--done {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  align-self: stretch;
  max-width: 100%;
  text-align: center;
  font-weight: 600;
  padding: 12px 16px;
}

/* Typing indicator */
.sbot-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 11px 14px;
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  animation: sbotFadeIn 0.3s ease forwards;
  flex-shrink: 0;
}
.sbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #A8364A;
  opacity: 0.35;
  animation: sbotDot 1.2s ease-in-out infinite;
}
.sbot-typing span:nth-child(2) { animation-delay: 0.18s; }
.sbot-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes sbotDot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30%            { opacity: 1;    transform: translateY(-5px); }
}

/* ── Input row ── */
.sbot-input-wrap {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #EDE6E1;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.sbot-input {
  flex: 1;
  border: 1.5px solid #E0D5CE;
  border-radius: 24px;
  padding: 9px 15px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  background: #FAFAFA;
  color: #2D2D2D;
  min-width: 0;
}
.sbot-input:focus       { border-color: #7B1C2E; background: #fff; }
.sbot-input:disabled    { opacity: 0.55; cursor: not-allowed; }
.sbot-input::placeholder { color: #B0A09A; }

.sbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B1C2E, #A8364A);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.sbot-send:hover    { transform: scale(1.1); }
.sbot-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .sbot-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 88px;
    max-height: 420px;
  }
  .sbot-btn { right: 16px; bottom: 16px; width: 56px; height: 56px; font-size: 1.3rem; }
}
