/* ======================================================
   RFF CHAT — MOBILE (iOS SAFE)
====================================================== */

@media (max-width: 700px) {

  /* Chat takes full screen */
  #rff-chat-box {
    position: fixed;
    inset: 0;

    display: none;
    flex-direction: column;

    background: rgba(0,0,0,0.92);
    z-index: 99999;
  }

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

  /* Messages scroll normally */
  #rff-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  /* INPUT ROW — NORMAL FLOW (THIS IS THE FIX) */
  #rff-input-row {
    position: relative;

    display: flex;
    gap: 8px;

    padding: 10px;
    background: #f8fafc;

    border-top: 1px solid rgba(0,0,0,0.1);
  }

  /* Input — REQUIRED for iOS */
/* Input — MOBILE (white, readable) */
#rff-chat-input {
    flex: 1;

    height: 44px;
    font-size: 16px; /* keeps iOS happy */

    background: #ffffff;
    color: #000000;

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

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

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

  /* Close button */
  #rff-chat-close {
    position: absolute;
    top: env(safe-area-inset-top);
    right: 12px;

    width: 40px;
    height: 40px;

    border-radius: 50%;
    border: none;

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

    font-size: 18px;
    z-index: 10;
  }
}
/* ======================================================
   STEELHEAD SAM — MOBILE AVATAR
====================================================== */

#sam-wrapper {
    position: fixed;
    bottom: 70px;
    right: 18px;

    width: 44px;
    height: 44px;

    z-index: 2147483648; /* ABOVE the chat button */
    pointer-events: none;
}

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

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

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

    box-shadow:
        0 0 6px rgba(0,255,102,0.6),
        0 0 14px rgba(0,255,102,0.4);

    animation: samGlowMobile 3s ease-in-out infinite;
}

/* Subtle mobile glow */
@keyframes samGlowMobile {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(10,143,85,0.6));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(10,200,120,0.9));
    }
}

/* ❌ No tooltip bubble on mobile */
#sam-bubble {
    display: none !important;
}
@media (max-width: 700px) {

	#sam-wrapper {
		position: fixed;
		bottom: 70px;     /* ⬇ closer to button */
		right: 18px;      /* ⬅ tuck toward button edge */
		
		width: 44px;
		height: 44px;

		z-index: 2147483647;
		pointer-events: none;
	}

  #sam-avatar {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      border: 2px solid #00ff66;
      background: #fff;

      pointer-events: auto;
  }

  /* Hide tooltip on small screens */
  #sam-bubble {
      display: none;
  }
}
@media (max-width: 700px) {

  #rff-chat-btn {
      bottom: 22px;
      right: 18px;

      padding: 16px 26px;          /* taller pill */
      font-size: 15px;
      border-radius: 999px;

      background: #065f46;
      color: #fff;
      font-weight: 600;

      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);

      z-index: 2147483646;
  }
}
/* 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;
}
@media (max-width: 700px) {
    .chat-bubble {
        font-size: 15px;
        line-height: 1.5;
    }

    .chat-bubble a {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}
/* -------------------------------
   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; }
}
@media (max-width: 700px) {
    .typing-indicator .dot {
        width: 7px;
        height: 7px;
    }
}
/* Sam (bot) messages — MOBILE */
.chat-msg.bot {
    display: flex;
    justify-content: flex-start;
}

.chat-msg.bot .chat-bubble {
    text-align: left;
    max-width: 88%;
    line-height: 1.55;
}
/* =========================================
   Sam — Continue in Full View (Readable)
   ========================================= */

.sam-full-link {
    display: block;
    text-align: center;
    margin: 0.6rem 0 0.4rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.85;
}

.sam-full-link a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.sam-full-link a::before {
    content: "↗ ";
    opacity: 0.7;
}

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

.sam-full-link {
    transition: opacity 0.3s ease;
}
/* ============================================================
   Sam Full Screen Header (Always Visible)
   ============================================================ */

.sam-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;

    display: flex;
    align-items: center;
    padding: 0 1rem;

    background: rgba(10, 15, 30, 0.98);
    border-bottom: 1px solid rgba(255,255,255,0.08);

    z-index: 9999;
}


.sam-back {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.sam-title {
    margin: 0 auto;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.sam-full-box {
    margin-top: 52px;
    height: calc(100vh - 52px);
}
