/*
 * Styles for the Rockstar Music chat widget
 *
 * These rules position the launcher button in the bottom right corner
 * of the viewport and style the chat panel.  Colours are chosen to be
 * high contrast and brand-friendly; adjust to match your palette as
 * needed.  The chat panel uses flexbox to lay out messages and the
 * input area, and hides offscreen until activated.
 */

/* Launcher button */
#rockstar-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background-color: #f05b4e; /* primary brand colour */
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 2147483647; /* ensure on top of most elements */
  transition: background-color 0.2s ease;
}

#rockstar-chat-launcher:hover {
  background-color: #c8473b; /* darker on hover */
}

#rockstar-chat-launcher img {
  width: 60%;
  height: 60%;
  pointer-events: none;
}

/* Chat panel container */
#rockstar-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  max-width: 100%;
  height: 480px;
  max-height: calc(100vh - 140px);
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483646;
}

#rockstar-chat-panel.open {
  display: flex;
}

/* Header */
.rockstar-chat-header {
  /* Updated to pastel orange to match pricing table */
  background-color: #f5a26b;
  color: #ffffff;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.rockstar-chat-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

/* Body */
.rockstar-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #fafafa;
  min-height: 0; /* allows inner elements to scroll */
}

/* Messages */
.rockstar-chat-messages {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
}

.rockstar-chat-message {
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  max-width: 80%;
  word-wrap: break-word;
}

.rockstar-chat-message.user {
  background-color: #e7ffe7;
  align-self: flex-end;
  color: #333333;
}

.rockstar-chat-message.bot {
  background-color: #f0f0f0;
  align-self: flex-start;
  color: #333333;
}

/* Input area */
.rockstar-chat-input-area {
  display: flex;
  padding: 8px;
  border-top: 1px solid #ddd;
  background-color: #ffffff;
}

.rockstar-chat-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.rockstar-chat-input:focus {
  outline: none;
  border-color: #f5a26b;
  box-shadow: 0 0 0 2px rgba(245, 162, 107, 0.2);
}

.rockstar-chat-send {
  margin-left: 6px;
  padding: 8px 12px;
  background-color: #f05b4e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.rockstar-chat-send:hover {
  background-color: #c8473b;
}

/* CTA button for booking a free trial */
.rockstar-chat-cta {
  margin: 8px;
  padding: 8px 12px;
  background-color: #f05b4e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  width: calc(100% - 16px);
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

.rockstar-chat-cta:hover {
  background-color: #c8473b;
}

/* Lead form */
.rockstar-lead-form {
  padding: 12px;
  overflow-y: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* allow form to consume vertical space and scroll */
  height: 100%;     /* fills available space */
  overflow-y: auto; /* enables scrolling */
}

.rockstar-lead-instructions {
  margin-bottom: 12px;
  font-weight: bold;
}

.rockstar-lead-field {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}

.rockstar-lead-field label {
  margin-bottom: 4px;
  font-size: 13px;
}

.rockstar-lead-field input,
.rockstar-lead-field select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.rockstar-lead-submit {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: #f05b4e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  align-self: flex-start;
  transition: background-color 0.2s ease;
}

.rockstar-lead-submit:hover {
  background-color: #c8473b;
}

.rockstar-lead-thanks,
.rockstar-lead-error {
  margin-top: 20px;
  font-size: 14px;
}

/* Quick start options */
.rockstar-chat-quick-options {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rockstar-chat-quick-option {
  padding: 6px 10px;
  background-color: #00c5bf; /* brand teal for option buttons */
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  flex-grow: 1;
  text-align: center;
  transition: background-color 0.2s ease;
}

.rockstar-chat-quick-option:hover {
  background-color: #00b5ad;
}

/* --- Chat additions (layout for quickbar, cards, actions) --- */
.rockstar-chat-quickbar { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 12px; }
.rockstar-chip {
  border:1px solid rgba(0,0,0,.1);
  background:#f5f6f8; border-radius:999px; padding:6px 10px;
  font-size:12px; cursor:pointer;
}
.rockstar-chip:hover { filter:brightness(0.98); }

.rockstar-chat-cards { display:grid; grid-template-columns: 1fr; gap:12px; margin:8px 0 12px; }
@media (min-width: 460px) { .rockstar-chat-cards { grid-template-columns: 1fr 1fr; } }

.rockstar-chat-actions { display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 10px; }
.rockstar-cta {
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:999px; padding:8px 14px; text-decoration:none; font-weight:700;
  font-size:14px; line-height:1; border:1px solid transparent;
}
.rockstar-cta--primary { background:#e11d48; color:#fff; }
.rockstar-cta--primary:hover { filter:brightness(1.05); }
.rockstar-cta--ghost { background:transparent; border-color:#d3d6de; color:#111; }
.rockstar-cta--ghost:hover { border-color:#b9bec9; }

/* --- V2 card system (brandable) --- */
:root {
  --rsm-bg: #0b0b0f;
  --rsm-card: #12121a;
  --rsm-elev: rgba(255,255,255,0.06);
  --rsm-text: #f5f7fb;
  --rsm-muted: #aab1c3;
  --rsm-accent: #e11d48;
  --rsm-accent-600: #be123c;
  --rsm-chip: #1b1b25;
  --rsm-border: rgba(255,255,255,0.08);
  --rsm-shadow: 0 6px 24px rgba(0,0,0,0.35);
  --rsm-radius: 16px;
}
.rsm-card {
  background: var(--rsm-card);
  color: var(--rsm-text);
  border: 1px solid var(--rsm-border);
  border-radius: var(--rsm-radius);
  box-shadow: var(--rsm-shadow);
  padding: 16px;
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-areas:
    "avatar header"
    "avatar tags"
    "avatar actions";
  gap: 12px 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  opacity:0; transform: translateY(8px);
}
.rsm-card.rsm-in { opacity:1; transform:none; transition: opacity .25s ease, transform .25s ease; }
.rsm-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.45); border-color: var(--rsm-elev); }

.rsm-avatar { grid-area: avatar; width: 64px; height: 64px; border-radius: 999px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; background: #1a1a24; border: 1px solid var(--rsm-border); text-decoration: none; }
.rsm-avatar__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rsm-avatar__initials { font-weight: 700; letter-spacing: .5px; color: var(--rsm-text); font-size: 18px; text-transform: uppercase; }

.rsm-card__header { grid-area: header; display:flex; flex-direction:column; justify-content:center; min-width:0; }
.rsm-card__name { color: var(--rsm-text); font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; display:inline-block; max-width:100%; }
.rsm-card__name:hover { text-decoration: underline; }
.rsm-card__sub { margin-top:4px; color:var(--rsm-muted); font-size:13px; }

.rsm-card__tags { grid-area: tags; display:flex; flex-wrap:wrap; gap:6px; }
.rsm-chip { background: var(--rsm-chip); border:1px solid var(--rsm-border); color: var(--rsm-muted); font-size:12px; line-height:20px; padding:0 8px; border-radius:999px; white-space:nowrap; }

.rsm-card__actions { grid-area: actions; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.rsm-btn { appearance:none; border:1px solid transparent; border-radius:999px; padding:8px 14px; font-weight:700; font-size:14px; line-height:1; text-decoration:none; transition: transform .12s ease, background-color .12s ease, border-color .12s ease; display:inline-flex; align-items:center; justify-content:center; }
.rsm-btn:active { transform: translateY(1px); }
.rsm-btn--primary { background: linear-gradient(180deg, var(--rsm-accent), var(--rsm-accent-600)); color:#fff; box-shadow: 0 6px 14px rgba(225,29,72,.35); }
.rsm-btn--primary:hover { filter: brightness(1.05); }
.rsm-btn--ghost { background: transparent; color: var(--rsm-text); border-color: var(--rsm-border); }
.rsm-btn--ghost:hover { border-color: var(--rsm-elev); }

.rsm-card__meta { grid-column: 1 / -1; margin-top:4px; color:var(--rsm-muted); font-size:12px; }
.rsm-meta-line { margin-top:2px; }

/* responsive */
@media (max-width: 420px) {
  .rsm-card {
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "avatar header"
      "tags tags"
      "actions actions";
  }
  .rsm-avatar { width: 48px; height: 48px; }
}

/* === V2.2 chat layout improvements === */

/* Make body scroll vertically even when cards are visible */
#rockstar-chat-panel .rockstar-chat-body {
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}

/* Messages area still scrolls */
#rockstar-chat-panel .rockstar-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 8px;
}

/* Quickbar chips row */
.rockstar-chat-quickbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.rockstar-chip {
  background: var(--rsm-chip,#1b1b25);
  border: 1px solid var(--rsm-border,rgba(255,255,255,.08));
  color: var(--rsm-muted,#aab1c3);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

/* Horizontal card rail + vertical scroll fallback */
.rockstar-chat-cards {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}
.rockstar-chat-cards::-webkit-scrollbar { height: 8px; }
.rockstar-chat-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }

.rsm-card {
  min-width: 320px;
  max-width: 360px;
  scroll-snap-align: start;
}

/* Action bar (CTAs + tel) */
.rockstar-chat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 8px;
}

/* Keep input fixed at the bottom and allow the whole panel to scroll */
#rockstar-chat-panel .rockstar-chat-input-area {
  margin-top: 8px;
  flex: 0 0 auto;
}

/* Small screens: make cards narrower to fit more info vertically */
@media (max-width: 420px) {
  .rsm-card { min-width: 280px; }
}

