/* ==========================================================================
   SERWAA NYARKO GIRLS SHS - AI SUPPORT CHATBOT STYLES
   Royal Purple (#24134a) & Ashanti Gold (#e5a823) Theme
   ========================================================================== */

/* Floating Launcher Button */
#sny-chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #24134a 0%, #3b1b6e 60%, #4a2080 100%);
  border: 2.5px solid #e5a823;
  box-shadow: 0 8px 24px rgba(36, 19, 74, 0.4), 0 0 0 4px rgba(229, 168, 35, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99990;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  outline: none;
}

#sny-chatbot-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(36, 19, 74, 0.5), 0 0 0 6px rgba(229, 168, 35, 0.3);
}

#sny-chatbot-launcher:active {
  transform: scale(0.95);
}

#sny-chatbot-launcher .launcher-icon {
  font-size: 1.6rem;
  color: #fde047;
  transition: transform 0.3s ease;
}

#sny-chatbot-launcher.open .launcher-icon-chat {
  display: none;
}

#sny-chatbot-launcher.open .launcher-icon-close {
  display: block;
}

#sny-chatbot-launcher:not(.open) .launcher-icon-close {
  display: none;
}

/* Online Pulse Indicator */
.sny-bot-online-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #22c55e;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.sny-bot-online-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: snyPulse 2s infinite;
  opacity: 0.8;
}

@keyframes snyPulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(2); opacity: 0; }
}

/* Greeting Teaser Bubble */
#sny-chatbot-teaser {
  position: fixed;
  bottom: 96px;
  right: 24px;
  background: #ffffff;
  border: 1.5px solid #e5a823;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  color: #1e1b4b;
  max-width: 270px;
  z-index: 99989;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: snySlideUp 0.35s ease-out;
  cursor: pointer;
}

#sny-chatbot-teaser::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 24px;
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

#sny-chatbot-teaser::before {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 23px;
  border-width: 9px 9px 0;
  border-style: solid;
  border-color: #e5a823 transparent;
  display: block;
  width: 0;
}

#sny-chatbot-teaser .teaser-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#sny-chatbot-teaser .teaser-close:hover {
  color: #ef4444;
}

/* Main Chat Dialog Window */
#sny-chatbot-window {
  position: fixed;
  bottom: 98px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 125px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(229, 168, 35, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99995;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#sny-chatbot-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Chat Header */
.sny-chat-header {
  background: linear-gradient(135deg, #1e0d3b 0%, #31185e 60%, #43217c 100%);
  color: #ffffff;
  padding: 14px 18px;
  border-bottom: 2.5px solid #e5a823;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sny-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sny-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e5a823;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  flex-shrink: 0;
  overflow: hidden;
}

.sny-chat-avatar img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sny-chat-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.sny-chat-header-sub {
  font-size: 0.72rem;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  margin-top: 2px;
}

.sny-chat-header-sub::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
}

.sny-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sny-chat-hdr-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}

.sny-chat-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fde047;
}

/* Quick Suggestion Chips Bar */
.sny-chat-chips-bar {
  background: #f8fafc;
  padding: 8px 14px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  flex-shrink: 0;
}

.sny-chat-chips-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.sny-chat-chip {
  background: #ffffff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.sny-chat-chip:hover {
  background: #ede9fe;
  border-color: #7c3aed;
  color: #43217c;
  transform: translateY(-1px);
}

/* Messages Scrollable Body */
.sny-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fafafa;
}

/* Message Rows */
.sny-msg-row {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: snyFadeIn 0.25s ease-out;
}

.sny-msg-bot {
  align-self: flex-start;
}

.sny-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.sny-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #24134a;
  color: #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  border: 1.5px solid #e5a823;
  margin-top: 2px;
}

.sny-msg-bubble {
  padding: 10px 14px;
  font-size: 0.86rem;
  line-height: 1.55;
  border-radius: 16px;
  word-break: break-word;
}

.sny-msg-bot .sny-msg-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-top-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.sny-msg-user .sny-msg-bubble {
  background: linear-gradient(135deg, #24134a 0%, #43217c 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 3px 10px rgba(36, 19, 74, 0.25);
}

.sny-msg-bubble p {
  margin: 0 0 8px;
}

.sny-msg-bubble p:last-child {
  margin: 0;
}

.sny-msg-bubble strong {
  color: #1e1b4b;
}

.sny-msg-user .sny-msg-bubble strong {
  color: #fde047;
}

.sny-msg-bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

.sny-msg-bubble li {
  margin-bottom: 4px;
}

.sny-msg-time {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 4px;
  text-align: right;
}

/* Interactive Action Buttons inside Bot Message */
.sny-msg-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.sny-msg-action-btn {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sny-msg-action-btn:hover {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}

/* Typing Indicator Animation */
.sny-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  border-top-left-radius: 4px;
  width: fit-content;
}

.sny-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7c3aed;
  animation: snyBounce 1.4s infinite ease-in-out both;
}

.sny-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.sny-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes snyBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* In-Chat Inquiry Card */
.sny-chat-inquiry-card {
  background: #ffffff;
  border: 1.5px solid #e5a823;
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.sny-chat-inquiry-card h5 {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e1b4b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sny-chat-inquiry-card p {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.sny-inquiry-field {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.8rem;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.sny-inquiry-field:focus {
  outline: none;
  border-color: #7c3aed;
}

.sny-inquiry-submit-btn {
  width: 100%;
  background: #24134a;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.sny-inquiry-submit-btn:hover {
  background: #43217c;
}

/* Chat Input Bar */
.sny-chat-input-area {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sny-chat-input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sny-chat-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.sny-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #24134a 0%, #43217c 100%);
  border: none;
  color: #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
}

.sny-chat-send-btn:hover {
  transform: scale(1.08);
  background: #1e0d3b;
}

.sny-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Chat Footer Branding */
.sny-chat-footer-brand {
  text-align: center;
  font-size: 0.68rem;
  color: #94a3b8;
  padding: 4px 8px 6px;
  background: #ffffff;
  border-top: 1px solid #f8fafc;
}

.sny-chat-footer-brand a {
  color: #7c3aed;
  text-decoration: none;
  font-weight: 700;
}

/* Keyframes */
@keyframes snySlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes snyFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  #sny-chatbot-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  #sny-chatbot-launcher {
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
  }

  #sny-chatbot-teaser {
    bottom: 84px;
    right: 18px;
    max-width: 240px;
  }
}
