/* ================================================
   ST Chat Widget - susanatoth.com
   Beagyazható barmely WP oldalba [st_chat_widget]
   Fugg: tema CSS valtozoi (--bg, --gold, stb.)
   ================================================ */

/* Launcher */
.st-chat-launcher {
  position: fixed; bottom: 24px; right: 24px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--gold); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25); z-index: 9998;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
.st-chat-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.35); }
.st-chat-launcher svg { width: 28px; height: 28px; fill: #08080c; }
.st-chat-launcher.open svg.icon-chat { display: none; }
.st-chat-launcher:not(.open) svg.icon-close { display: none; }
.st-chat-launcher.open svg.icon-close { display: block; }

.st-chat-launcher::before {
  content: ''; position: absolute; width: 100%; height: 100%;
  border-radius: 50%; background: var(--gold); opacity: 0;
  animation: st-pulse 3s ease-in-out infinite;
}
.st-chat-launcher.open::before { animation: none; }
@keyframes st-pulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.4); opacity: 0.15; }
}

.st-chat-launcher .st-badge {
  position: absolute; top: -2px; right: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--red, #c4243b); border: 2px solid var(--bg); font-size: 0;
}
.st-chat-launcher.open .st-badge { display: none; }

/* Panel */
.st-chat-panel {
  position: fixed; bottom: 96px; right: 24px;
  width: 380px; max-height: 580px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(0,0,0,0.2); z-index: 9999;
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(0.96); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Inter', sans-serif;
}
.st-chat-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Header */
.st-chat-header {
  padding: 16px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.st-chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px;
  color: #08080c; flex-shrink: 0;
}
.st-chat-header-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 600; color: var(--text); margin: 0;
}
.st-chat-header-info p { font-size: 12px; color: var(--text-muted); margin: 0; }
.st-status { display: inline-flex; align-items: center; gap: 5px; }
.st-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2ecc71; display: inline-block;
}

/* Messages */
.st-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 200px; max-height: 360px;
}
.st-chat-messages::-webkit-scrollbar { width: 4px; }
.st-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.st-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.5; animation: st-msg-in 0.3s ease;
}
@keyframes st-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.st-msg.bot {
  align-self: flex-start; background: var(--surface); color: var(--text);
  border-bottom-left-radius: 4px;
}
.st-msg.user {
  align-self: flex-end; background: var(--gold); color: #08080c;
  border-bottom-right-radius: 4px;
}
.st-msg a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.st-msg.user a { color: #08080c; }

/* Quick replies */
.st-quick-replies {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
  animation: st-msg-in 0.3s ease;
}
.st-quick-btn {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--gold);
  background: transparent; color: var(--gold);
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.st-quick-btn:hover { background: var(--gold); color: #08080c; }

/* Typing */
.st-typing {
  align-self: flex-start; display: flex; gap: 4px;
  padding: 12px 16px; background: var(--surface);
  border-radius: 14px; border-bottom-left-radius: 4px;
}
.st-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); animation: st-typing-anim 1.2s infinite;
}
.st-typing span:nth-child(2) { animation-delay: 0.2s; }
.st-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes st-typing-anim {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input area */
.st-chat-input-area {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center; background: var(--card);
}
.st-chat-input-area.disabled { opacity: 0.4; pointer-events: none; }
.st-chat-input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 13.5px;
  outline: none; transition: border-color 0.2s;
}
.st-chat-input::placeholder { color: var(--text-muted); }
.st-chat-input:focus { border-color: var(--gold); }
.st-chat-send {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--gold); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, opacity 0.2s; flex-shrink: 0;
}
.st-chat-send:hover { transform: scale(1.05); }
.st-chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.st-char-counter { font-size: 10px; color: var(--text-muted); align-self: center; flex-shrink: 0; min-width: 40px; text-align: right; }
.st-chat-send svg { width: 18px; height: 18px; fill: #08080c; }

/* Footer */
.st-chat-footer {
  text-align: center; padding: 6px; font-size: 10px;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
}

/* GDPR screen */
.st-gdpr-screen {
  padding: 24px 20px; display: flex; flex-direction: column; gap: 16px;
  flex: 1; justify-content: center;
}
.st-gdpr-screen p {
  font-size: 13px; color: var(--text); line-height: 1.6; margin: 0;
}
.st-gdpr-screen .st-gdpr-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: 16px; color: var(--text);
}
.st-gdpr-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
}
.st-gdpr-check input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold);
  cursor: pointer; flex-shrink: 0;
}
.st-gdpr-check label {
  font-size: 12px; color: var(--text-muted); line-height: 1.5; cursor: pointer;
}
.st-gdpr-check label a {
  color: var(--gold); text-decoration: underline; text-underline-offset: 2px;
}
.st-gdpr-start {
  padding: 12px 24px; border-radius: 10px; border: none;
  background: var(--gold); color: #08080c;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: 14px; cursor: pointer; transition: opacity 0.2s, transform 0.2s;
  align-self: flex-start;
}
.st-gdpr-start:hover { transform: scale(1.02); }
.st-gdpr-start:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* Email form (in-chat) */
.st-email-form {
  align-self: flex-start; max-width: 90%;
  background: var(--surface); border-radius: 14px; border-bottom-left-radius: 4px;
  padding: 14px; animation: st-msg-in 0.3s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.st-email-form p {
  font-size: 12.5px; color: var(--text); line-height: 1.5; margin: 0;
}
.st-email-form input[type="email"] {
  padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px;
  outline: none; width: 100%;
}
.st-email-form input[type="email"]:focus { border-color: var(--gold); }
.st-email-form button {
  padding: 9px 18px; border-radius: 8px; border: none;
  background: var(--gold); color: #08080c;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12.5px;
  cursor: pointer; align-self: flex-start; transition: transform 0.2s;
}
.st-email-form button:hover { transform: scale(1.02); }
.st-email-form .st-email-note {
  font-size: 10.5px; color: var(--text-muted); line-height: 1.4;
}

/* Mobile */
@media (max-width: 768px) {
  .st-chat-launcher,
  .st-chat-panel { display: none !important; }
}
