/* ============================================
   STRENGTH FOR ATHLETES — CHATBOT PRO STYLES
   ============================================ */

/* ===== BUBBLE ===== */
#sfa-chatbot {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 9999;
  font-family: 'Inter', system-ui, sans-serif;
}

.sfa-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0a500 0%, #fbbf24 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(240,165,0,0.45), 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s ease;
  position: relative;
  z-index: 2;
}
.sfa-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(240,165,0,0.55), 0 4px 12px rgba(0,0,0,0.15);
}
.sfa-bubble:active { transform: scale(0.96); }

.sfa-bubble-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
}

/* Ping animation */
.sfa-bubble-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(240,165,0,0.35);
  animation: sfa-ping 2s ease-in-out infinite;
}
@keyframes sfa-ping {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Unread badge */
.sfa-unread {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: sfa-bounce-in 0.4s cubic-bezier(0.16,1,0.3,1);
}
@keyframes sfa-bounce-in {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== WINDOW ===== */
.sfa-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  height: 580px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 4px 24px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;
  transform-origin: bottom right;
}
.sfa-window.sfa-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ===== HEADER ===== */
.sfa-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  flex-shrink: 0;
}

.sfa-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0a500, #fbbf24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.sfa-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #111827;
}

.sfa-header-info { flex: 1; min-width: 0; }
.sfa-header-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sfa-header-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.sfa-header-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: sfa-blink 1.8s ease-in-out infinite;
}
@keyframes sfa-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.sfa-header-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.sfa-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.sfa-header-btn:hover { background: rgba(240,165,0,0.25); color: #f0a500; }

/* ===== MESSAGES ===== */
.sfa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f9fafb;
  scroll-behavior: smooth;
}
.sfa-messages::-webkit-scrollbar { width: 3px; }
.sfa-messages::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

/* Welcome card */
.sfa-welcome-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.sfa-welcome-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0a500, #fbbf24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  margin: 0 auto 0.75rem;
  box-shadow: 0 4px 16px rgba(240,165,0,0.3);
}
.sfa-welcome-title { font-size: 1rem; font-weight: 700; color: #111827; margin-bottom: 0.4rem; }
.sfa-welcome-sub   { font-size: 0.82rem; color: #6b7280; line-height: 1.5; }

/* Message rows */
.sfa-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 0.25rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sfa-msg-enter { opacity: 0; transform: translateY(10px); }

.sfa-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}
.sfa-msg-assistant {
  align-self: flex-start;
  align-items: flex-start;
}

/* Bubbles */
.sfa-msg-bubble {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.sfa-msg-user .sfa-msg-bubble {
  background: linear-gradient(135deg, #f0a500, #fbbf24);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(240,165,0,0.25);
}
.sfa-msg-assistant .sfa-msg-bubble {
  background: #fff;
  color: #374151;
  border-bottom-left-radius: 4px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.sfa-msg-assistant .sfa-msg-bubble strong { color: #111827; }
.sfa-msg-assistant .sfa-msg-bubble a { color: #f0a500; text-decoration: underline; }

/* Timestamp */
.sfa-msg-time {
  font-size: 0.68rem;
  color: #9ca3af;
  padding: 0 0.25rem;
}

/* Typing indicator */
.sfa-typing-row { max-width: 72px; }
.sfa-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem !important;
}
.sfa-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d5db;
  animation: sfa-typing-dot 1.2s ease-in-out infinite;
}
.sfa-typing span:nth-child(2) { animation-delay: 0.2s; }
.sfa-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sfa-typing-dot {
  0%,60%,100% { transform: translateY(0); background: #d1d5db; }
  30%         { transform: translateY(-5px); background: #f0a500; }
}

/* ===== SUGGESTIONS ===== */
.sfa-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
  flex-shrink: 0;
  min-height: 0;
}
.sfa-suggestion-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sfa-suggestion-btn:hover {
  border-color: #f0a500;
  color: #f0a500;
  background: rgba(240,165,0,0.04);
}

/* ===== INPUT AREA ===== */
.sfa-input-area {
  padding: 0.85rem 1rem 0.85rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sfa-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  transition: border-color 0.2s;
}
.sfa-input-wrap:focus-within { border-color: #f0a500; background: #fff; }

.sfa-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.88rem;
  color: #111827;
  resize: none;
  outline: none;
  min-height: 22px;
  max-height: 120px;
  line-height: 1.5;
  overflow-y: auto;
}
.sfa-input::placeholder { color: #9ca3af; }

.sfa-send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0a500, #fbbf24);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(240,165,0,0.3);
}
.sfa-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 4px 12px rgba(240,165,0,0.4); }
.sfa-send:disabled { background: #e5e7eb; color: #9ca3af; box-shadow: none; cursor: not-allowed; }

.sfa-footer-note {
  font-size: 0.68rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 0.5rem;
}
.sfa-footer-note a { color: #f0a500; text-decoration: none; }
.sfa-footer-note a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  #sfa-chatbot { bottom: 1rem; right: 1rem; }
  .sfa-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 5rem);
    bottom: 72px;
    right: 0;
    border-radius: 16px;
  }
}
