﻿/* ======================================================
   RFF CHAT — DESKTOP BASELINE
====================================================== */

/* Ask Steelhead Sam button */
#rff-chat-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;

  padding: 14px 20px;
  border-radius: 999px;

  background: #065f46;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;

  cursor: pointer;
  z-index: 1000001;

  box-shadow:
    0 0 0 3px rgba(29,185,84,0.35),
    0 0 18px rgba(29,185,84,0.6),
    0 8px 24px rgba(0,0,0,0.45);
}

/* Chat container */
#rff-chat-box {
  position: fixed;
  bottom: 80px;
  right: 22px;

  width: 340px;
  max-height: 520px;

  background: rgba(0,0,0,0.9);
  border-radius: 16px;

  display: none;
  flex-direction: column;
  overflow: hidden;

  z-index: 99999;
}

#rff-chat-box.open {
  display: flex;
}

/* Messages */
#rff-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Bot message */
#rff-chat-messages .bot {
  align-self: flex-start;
  max-width: 80%;

  background: rgba(255,255,255,0.12);
  color: #fff;

  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;

  font-size: 14px;
  line-height: 1.45;
}

/* User message */
#rff-chat-messages .user {
  align-self: flex-end;
  max-width: 80%;

  background: #1db954;
  color: #000;

  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;

  font-size: 14px;
  line-height: 1.45;
}

/* Input row */
#rff-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;

  background: #0e141b;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Input */
#rff-chat-input {
  flex: 1;
  background: #ffffff;
  color: #000000;

  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 10px 12px;

  font-size: 14px;
}

#rff-chat-input::placeholder {
  color: rgba(0,0,0,0.5);
}

#rff-chat-input:focus {
  outline: none;
  border-color: #1db954; /* Sam green */
  box-shadow: 0 0 0 1px rgba(29,185,84,0.25);
}

/* Voice button */
#rff-voice-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #1db954;
}
/* ======================================================
   STEELHEAD SAM — FLOATING AVATAR (DESKTOP ONLY)
====================================================== */

#sam-wrapper {
    position: fixed;
    bottom: 62px;   /* sits just above chat button */
    right: 40px;    /* overlaps button slightly */

    width: 46px;
    height: 46px;

    z-index: 2147483648;
    pointer-events: none; /* wrapper doesn't block clicks */
}

/* Sam avatar image */
#sam-avatar {
    width: 100%;
    height: 100%;

    border-radius: 50%;
    border: 2px solid #00ff66;
    background: #ffffff;
    object-fit: cover;

    cursor: pointer;
    pointer-events: auto; /* image IS clickable */

    box-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
    animation: samGlow 3s ease-in-out infinite;
    transition: transform 0.2s ease;
}

/* Hover pop (desktop only) */
@media (hover:hover) {
    #sam-avatar:hover {
        transform: scale(1.08);
    }
}

/* Glow animation */
@keyframes samGlow {
    0% {
        filter:
          drop-shadow(0 0 4px rgba(10,143,85,0.5))
          drop-shadow(0 0 10px rgba(10,200,120,0.3));
    }
    50% {
        filter:
          drop-shadow(0 0 10px rgba(10,143,85,1))
          drop-shadow(0 0 18px rgba(10,200,120,0.6));
    }
    100% {
        filter:
          drop-shadow(0 0 4px rgba(10,143,85,0.5))
          drop-shadow(0 0 10px rgba(10,200,120,0.3));
    }
}
/* ======================================================
   STEELHEAD SAM — TOOLTIP BUBBLE
====================================================== */

#sam-bubble {
    position: fixed;
    bottom: 128px;
    right: 18px;

    background: #ffffff;
    color: #000000;
    font-size: 13px;

    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid #00ff66;

    box-shadow:
      0 0 12px rgba(0,255,102,0.35),
      0 2px 8px rgba(0,0,0,0.25);

    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;

    pointer-events: none;
    white-space: nowrap;

    z-index: 99996;
}

/* Arrow */
#sam-bubble::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 20px;

    border-width: 6px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

/* Show bubble */
#sam-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide when chat open */
body.rff-chat-open #sam-bubble {
    opacity: 0 !important;
    transform: translateY(10px) !important;
}

/* Hide bubble on very small screens */
@media (max-width: 450px) {
    #sam-bubble {
        display: none;
    }
}
/* Ensure chat bubbles contain all content */
.chat-bubble {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.chat-bubble a {
    display: inline;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;

    color: #7dd3fc; /* or your brand color */
    text-decoration: underline;
}
.chat-bubble a {
    font-weight: 500;
}

.chat-bubble a:hover {
    text-decoration: none;
    opacity: 0.9;
}
/* -------------------------------
   Sam "thinking" indicator
-------------------------------- */

#rff-typing {
    display: none;
    align-items: center;
    padding: 8px 12px;
    margin: 6px 0 2px;
}

#rff-typing.show {
    display: flex;
}

.typing-indicator .dot {
    width: 6px;
    height: 6px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: samTyping 1.4s infinite ease-in-out both;
}

.typing-indicator .dot:nth-child(1) { animation-delay: 0s; }
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes samTyping {
    0%   { opacity: 0.25; }
    20%  { opacity: 1; }
    100% { opacity: 0.25; }
}
/* Sam (bot) messages */
.chat-msg.bot {
  display: flex;
  justify-content: flex-start;
}

.chat-msg.bot .chat-bubble {
  text-align: left;
  max-width: 85%;
  line-height: 1.55;
}
.sam-full-link {
    text-align: center;
    margin: 0.5rem 0 0.25rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

.sam-full-link a {
    text-decoration: none;
}

.sam-full-link a:hover {
    opacity: 0.85;
}