/* SmartScheduleAI Frontend CSS v1.0 */

/* ── SOCIAL PROOF NOTIFICATIONS ── */
.ssa-social-proof {
  position: fixed;
  bottom: 100px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(13,17,28,0.96);
  border: 1px solid rgba(0,194,255,0.25);
  border-radius: 14px;
  padding: 12px 16px;
  max-width: 300px;
  z-index: 9990;
  transform: translateX(-120%);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.ssa-social-proof.ssa-sp-show { transform: translateX(0); }
.ssa-sp-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg,#0EA5E9,#0369A1);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white; flex-shrink: 0;
}
.ssa-sp-text { font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.5; }
.ssa-sp-text strong { color: white; font-weight: 600; }

/* ── STICKY BAR ── */
#ssa-sticky-bar {
  position: fixed;
  bottom: -80px;
  left: 0; right: 0;
  background: linear-gradient(135deg,#0A1F3A,#061325);
  border-top: 1px solid rgba(0,194,255,0.3);
  z-index: 9980;
  transition: bottom 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.4);
}
#ssa-sticky-bar.ssa-sticky-show { bottom: 0; }
.ssa-sticky-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 20px; padding: 14px 20px; flex-wrap: wrap;
}
.ssa-sticky-text { font-size: 14px; color: rgba(255,255,255,0.7); }
.ssa-sticky-text strong { color: #00C2FF; }
.ssa-sticky-timer { color: #FCD34D; font-family: monospace; }
.ssa-sticky-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg,#00B4D8,#0077B6);
  border-radius: 8px; font-size: 14px; font-weight: 700;
  color: white; text-decoration: none; white-space: nowrap;
  transition: opacity 0.2s;
}
.ssa-sticky-btn:hover { opacity: 0.88; }
.ssa-sticky-close {
  background: none; border: none; color: rgba(255,255,255,0.3);
  cursor: pointer; font-size: 18px; padding: 4px; line-height: 1;
}

/* ── EXIT POPUP ── */
#ssa-popup-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#ssa-popup-overlay.ssa-popup-show { opacity: 1; pointer-events: all; }
#ssa-popup {
  background: linear-gradient(135deg,#0A1F3A,#061325);
  border: 1px solid rgba(0,194,255,0.3);
  border-radius: 24px; padding: 40px 36px;
  max-width: 480px; width: 100%; position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,194,255,0.1);
}
#ssa-popup-overlay.ssa-popup-show #ssa-popup { transform: scale(1) translateY(0); }
.ssa-popup-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.06); border: none;
  color: rgba(255,255,255,0.4); cursor: pointer;
  font-size: 18px; width: 32px; height: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ssa-popup-close:hover { background: rgba(255,255,255,0.12); color: white; }
.ssa-popup-badge {
  display: inline-block; padding: 4px 14px;
  background: rgba(0,194,255,0.15); border: 1px solid rgba(0,194,255,0.3);
  border-radius: 20px; font-size: 11px; font-weight: 700;
  color: #48CAE4; letter-spacing: 1px; margin-bottom: 16px;
}
.ssa-popup-title {
  font-size: 28px; font-weight: 900; color: white;
  letter-spacing: -1px; line-height: 1.1; margin-bottom: 10px;
}
.ssa-popup-sub { font-size: 15px; color: rgba(255,255,255,0.5); margin-bottom: 16px; }
.ssa-popup-timer {
  background: rgba(0,194,255,0.08); border: 1px solid rgba(0,194,255,0.2);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 20px;
  font-size: 14px; color: rgba(255,255,255,0.6);
}
.ssa-popup-timer strong { color: #FCD34D; font-family: monospace; font-size: 18px; margin-left: 6px; }
.ssa-input {
  width: 100%; padding: 12px 16px; margin-bottom: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: white; font-size: 14px; outline: none;
  box-sizing: border-box; transition: border-color 0.2s;
  font-family: inherit;
}
.ssa-input:focus { border-color: rgba(0,194,255,0.5); }
.ssa-input::placeholder { color: rgba(255,255,255,0.3); }
.ssa-checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 10px;
  cursor: pointer; line-height: 1.5;
}
.ssa-checkbox-label input { margin-top: 2px; accent-color: #00C2FF; flex-shrink: 0; }
.ssa-popup-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg,#00B4D8,#0077B6);
  border: none; border-radius: 12px; color: white;
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,194,255,0.3);
  transition: all 0.2s; margin-top: 6px;
  font-family: inherit;
}
.ssa-popup-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0,194,255,0.4); }
.ssa-popup-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.ssa-popup-legal { font-size: 11px; color: rgba(255,255,255,0.2); text-align: center; margin-top: 10px; }

/* ── SALLY CHATBOT ── */
#ssa-sally-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 9970;
}
#ssa-sally-toggle {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg,#0EA5E9,#0369A1);
  border: none; cursor: pointer; position: relative;
  box-shadow: 0 4px 24px rgba(14,165,233,0.4);
  transition: transform 0.2s;
  overflow: visible;
}
#ssa-sally-toggle:hover { transform: scale(1.08); }
.ssa-sally-toggle-inner { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ssa-sally-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ssa-sally-fallback { font-size: 24px; font-weight: 900; color: white; }
.ssa-sally-pulse {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px; background: #22C55E;
  border-radius: 50%; border: 2px solid #07090F;
}
.ssa-sally-badge {
  position: absolute; top: -8px; right: -8px;
  background: #EF4444; color: white; border-radius: 50%;
  width: 24px; height: 24px; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  animation: badgeBounce 0.5s ease;
}
@keyframes badgeBounce { 0%{transform:scale(0)} 60%{transform:scale(1.2)} 100%{transform:scale(1)} }

#ssa-sally-window {
  position: absolute; bottom: 80px; right: 0;
  width: 340px; background: #0D1120;
  border: 1px solid rgba(14,165,233,0.25); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.8) translateY(20px); transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; flex-direction: column; height: 460px;
}
#ssa-sally-window.ssa-sally-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
.ssa-sally-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.ssa-sally-header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ssa-sally-header-avatar-fb { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#0EA5E9,#0369A1); display: flex; align-items: center; justify-content: center; font-weight: 800; color: white; font-size: 14px; }
.ssa-sally-header-info { flex: 1; }
.ssa-sally-header-info strong { display: block; font-size: 14px; font-weight: 700; color: white; }
.ssa-sally-header-info span { font-size: 11px; color: rgba(255,255,255,0.35); }
.ssa-sally-close-btn { background: none; border: none; color: rgba(255,255,255,0.3); cursor: pointer; font-size: 18px; padding: 4px; }
#ssa-sally-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#ssa-sally-messages::-webkit-scrollbar { width: 3px; }
#ssa-sally-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.ssa-sally-msg { display: flex; align-items: flex-end; gap: 8px; }
.ssa-sally-msg-user { flex-direction: row-reverse; }
.ssa-msg-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ssa-msg-avatar-fb { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#0EA5E9,#0369A1); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: white; flex-shrink: 0; }
.ssa-sally-bubble {
  max-width: 240px; padding: 10px 14px; border-radius: 16px;
  font-size: 13px; line-height: 1.5;
}
.ssa-sally-msg-assistant .ssa-sally-bubble {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8);
  border-radius: 4px 16px 16px 16px;
}
.ssa-sally-msg-user .ssa-sally-bubble {
  background: linear-gradient(135deg,#0EA5E9,#0369A1); color: white;
  border-radius: 16px 4px 16px 16px;
}
.ssa-typing-dots { display: flex; gap: 4px; padding: 12px 16px; background: rgba(255,255,255,0.06); border-radius: 4px 16px 16px 16px; }
.ssa-typing-dots span { width: 6px; height: 6px; background: rgba(255,255,255,0.4); border-radius: 50%; animation: typingDot 1.2s infinite; }
.ssa-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ssa-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100%{transform:translateY(0);opacity:0.4} 30%{transform:translateY(-6px);opacity:1} }
.ssa-sally-input-wrap {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
#ssa-sally-input {
  flex: 1; padding: 10px 14px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: white; font-size: 13px; outline: none;
  font-family: inherit;
}
#ssa-sally-input:focus { border-color: rgba(14,165,233,0.5); }
#ssa-sally-input::placeholder { color: rgba(255,255,255,0.25); }
.ssa-sally-send {
  width: 38px; height: 38px;
  background: linear-gradient(135deg,#0EA5E9,#0369A1);
  border: none; border-radius: 10px; color: white;
  font-size: 16px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
}
.ssa-sally-send:hover { opacity: 0.85; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #ssa-sally-widget { bottom: 16px; right: 16px; }
  #ssa-sally-window { width: calc(100vw - 32px); right: -8px; bottom: 72px; }
  #ssa-sally-toggle { width: 54px; height: 54px; }
  .ssa-social-proof { max-width: calc(100vw - 48px); left: 12px; bottom: 80px; }
  #ssa-sticky-bar { padding: 10px 16px; }
  .ssa-sticky-inner { gap: 10px; padding: 10px 16px; }
  .ssa-sticky-text { font-size: 12px; }
  .ssa-sticky-btn { padding: 8px 16px; font-size: 13px; }
}
@media (max-width: 480px) {
  #ssa-sally-window { width: calc(100vw - 24px); right: -4px; }
  #ssa-popup { padding: 28px 20px; margin: 10px; }
  #ssa-popup-overlay { padding: 10px; }
  .ssa-popup-title { font-size: 22px; }
  .ssa-sticky-text span { display: none; }
}
