/* Secourys Chatbot — styles */
:root {
  --scb-color: #CC0000;
  --scb-radius: 16px;
  --scb-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  --scb-z: 99999;
  --scb-window-w: 360px;
  --scb-window-h: 520px;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
#secourys-chatbot-wrapper {
  position: fixed;
  bottom: 24px;
  z-index: var(--scb-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#secourys-chatbot-wrapper.secourys-pos-right { right: 24px; }
#secourys-chatbot-wrapper.secourys-pos-left  { left: 24px; align-items: flex-start; }

/* ── Bubble button ───────────────────────────────────────────────────────── */
.secourys-chat-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--scb-color);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: scb-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  flex-shrink: 0;
}

.secourys-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.secourys-chat-bubble:active {
  transform: scale(0.96);
}

@keyframes scb-pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Chat window ─────────────────────────────────────────────────────────── */
.secourys-chat-window {
  width: var(--scb-window-w);
  max-height: var(--scb-window-h);
  border-radius: var(--scb-radius);
  box-shadow: var(--scb-shadow);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* hidden by default — shown via JS class */
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.secourys-chat-window.secourys-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.secourys-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--scb-color);
  color: #fff;
  flex-shrink: 0;
}

.secourys-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secourys-header-icon {
  flex-shrink: 0;
}

.secourys-chat-title {
  font-size: 15px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
}

.secourys-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secourys-lang-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  transition: background 0.15s;
  white-space: nowrap;
}

.secourys-lang-btn:hover {
  background: rgba(255,255,255,0.3);
}

.secourys-close-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.secourys-close-btn:hover {
  opacity: 1;
}

/* ── Messages ────────────────────────────────────────────────────────────── */
.secourys-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f7f7;
  scroll-behavior: smooth;
}

.secourys-message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: scb-msg-in 0.2s ease both;
}

@keyframes scb-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.secourys-bot-message {
  background: #fff;
  color: #222;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.secourys-user-message {
  background: var(--scb-color);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* ── Typing indicator ────────────────────────────────────────────────────── */
.secourys-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  min-width: 56px;
}

.secourys-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bbb;
  animation: scb-bounce 1.2s infinite ease-in-out;
}

.secourys-typing span:nth-child(1) { animation-delay: 0s;    }
.secourys-typing span:nth-child(2) { animation-delay: 0.18s; }
.secourys-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes scb-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%            { transform: scale(1);   opacity: 1;   }
}

/* ── Input area ──────────────────────────────────────────────────────────── */
.secourys-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.secourys-user-input {
  flex: 1;
  resize: none;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s;
  max-height: 100px;
  overflow-y: auto;
}

.secourys-user-input:focus {
  border-color: var(--scb-color);
}

.secourys-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--scb-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.secourys-send-btn:hover {
  opacity: 0.88;
}

.secourys-send-btn:active {
  transform: scale(0.93);
}

.secourys-send-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ── Page ask-form ───────────────────────────────────────────────────────── */
.secourys-ask-form {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px;
  max-width: 480px;
  box-sizing: border-box;
}

.secourys-ask-form .secourys-ask-input {
  flex: 1 1 auto !important;
  min-width: 0;
  width: auto !important;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  outline: none;
  transition: border-color 0.15s;
  margin: 0 !important;
}

.secourys-ask-form .secourys-ask-input:focus {
  border-color: var(--scb-color);
}

.secourys-ask-form .secourys-ask-btn {
  flex: 0 0 auto !important;
  width: 42px !important;
  height: 42px !important;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.15s;
  padding: 0;
  margin: 0 !important;
}

.secourys-ask-form .secourys-ask-btn:hover  { opacity: 0.88; }
.secourys-ask-form .secourys-ask-btn:active { transform: scale(0.93); }

/* ── Bubble row (label + button) ─────────────────────────────────────────── */
.secourys-bubble-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secourys-bubble-label {
  background: #fff;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  white-space: nowrap;
  animation: scb-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: none;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #secourys-chatbot-wrapper {
    bottom: 16px;
    right: 16px !important;
    left: auto !important;
    align-items: flex-end !important;
  }

  .secourys-chat-window {
    width: calc(100vw - 32px);
    max-height: 70vh;
  }

  .secourys-pos-left .secourys-chat-window {
    /* same full-width layout on mobile */
  }
}
