/* ============================================================================
   Premier Sports Help Centre — Styles v6
   Black (#0A0A0A) + Yellow (#FFFF00) | Font: Poppins
   Changes: landscape logo, chat header logo, B2B link under search
   ============================================================================ */

:root {
  --ps-black: #0A0A0A;
  --ps-dark: #111111;
  --ps-dark-surface: #161616;
  --ps-dark-elevated: #222222;
  --ps-gold: #FFFF00;
  --ps-gold-muted: rgba(255, 255, 0, 0.08);
  --ps-gold-border: rgba(255, 255, 0, 0.25);
  --ps-gold-hover: rgba(255, 255, 0, 0.15);
  --ps-white: #FFFFFF;
  --ps-text: #FFFFFF;
  --ps-text-secondary: rgba(255, 255, 255, 0.6);
  --ps-text-muted: rgba(255, 255, 255, 0.35);
  --ps-user-bubble: #0A0A0A;
  --ps-user-border: #FFFF00;
  --ps-bot-bubble: #161616;
  --ps-bot-border: rgba(255, 255, 0, 0.15);
  --ps-input-bg: #161616;
  --ps-input-border: #333;
  --ps-error: #FF4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 50px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --font: 'Poppins', sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --chat-width: 420px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ps-text);
  background: var(--ps-black);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ps-gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================================
   HEADER — with landscape logo
   ============================================================================ */

.hc-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ps-black);
  border-bottom: 2px solid var(--ps-gold);
}

.hc-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hc-brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.hc-brand-divider {
  color: var(--ps-text-muted);
  font-weight: 300;
  font-size: 24px;
  line-height: 1;
}

.hc-brand-text {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.3px;
  color: var(--ps-text);
}

.hc-back-link {
  font-size: 13px;
  color: var(--ps-text-secondary);
}

/* ============================================================================
   HERO / SEARCH
   ============================================================================ */

.hc-hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  text-align: center;
}

.hc-hero h1 {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 28px;
  letter-spacing: -0.5px;
}

.hc-search-wrapper {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.hc-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ps-text-muted);
  pointer-events: none;
  z-index: 2;
}

.hc-search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  background: var(--ps-dark-surface);
  border: 2px solid var(--ps-dark-elevated);
  border-radius: var(--radius-lg);
  color: var(--ps-text);
  font-family: var(--font);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.hc-search-input:focus { border-color: var(--ps-gold); }
.hc-search-input::placeholder { color: var(--ps-text-muted); }

/* B2B link under search */
.hc-hero .hc-b2b-link {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ps-text-muted);
}

.hc-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--ps-dark-elevated);
  border: 1px solid var(--ps-gold-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
}

.hc-search-result-item {
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.hc-search-result-item:hover { background: var(--ps-gold-hover); }
.hc-search-result-item:last-child { border-bottom: none; }

.hc-search-result-item .result-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.hc-search-result-item .result-category {
  font-size: 12px;
  color: var(--ps-text-muted);
}

.hc-search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--ps-text-secondary);
  font-size: 14px;
}

/* ============================================================================
   CATEGORIES
   ============================================================================ */

.hc-categories {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hc-category-card {
  background: var(--ps-dark-surface);
  border: 1px solid var(--ps-dark-elevated);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-align: center;
}

.hc-category-card:hover {
  border-color: var(--ps-gold-border);
  background: var(--ps-gold-muted);
  transform: translateY(-3px);
}

.hc-category-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: var(--ps-gold-muted);
  border: 1px solid var(--ps-gold-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.hc-category-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.hc-category-card p { font-size: 13px; color: var(--ps-text-secondary); }

/* ============================================================================
   POPULAR ARTICLES
   ============================================================================ */

.hc-popular { max-width: 1100px; margin: 0 auto; padding: 0 24px 50px; }
.hc-popular h2 { font-size: 22px; font-weight: 600; margin-bottom: 18px; }
.hc-popular-list { display: flex; flex-direction: column; gap: 2px; }

.hc-popular-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--ps-dark-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 15px;
  font-weight: 500;
}

.hc-popular-item:hover { background: var(--ps-gold-muted); padding-left: 24px; }
.hc-popular-item::before { content: ''; width: 6px; height: 6px; background: var(--ps-gold); border-radius: 50%; flex-shrink: 0; }

/* ============================================================================
   ARTICLE VIEW & CATEGORY VIEW
   ============================================================================ */

.hc-article-view, .hc-category-view { max-width: 750px; margin: 0 auto; padding: 20px 24px 60px; }

.hc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--ps-gold);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 20px;
}

.hc-back-btn:hover { text-decoration: underline; }

.hc-article-content h2 { font-size: 26px; font-weight: 700; margin-bottom: 20px; line-height: 1.3; }
.hc-article-content .article-body { font-size: 15px; line-height: 1.8; color: var(--ps-text-secondary); }
.hc-article-content .article-body p { margin-bottom: 16px; }
.hc-article-content .article-body ol, .hc-article-content .article-body ul { margin: 12px 0 16px 24px; }
.hc-article-content .article-body li { margin-bottom: 8px; color: var(--ps-text); }

.hc-article-helpful { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--ps-dark-elevated); display: flex; align-items: center; gap: 14px; }
.hc-article-helpful p { font-size: 14px; color: var(--ps-text-secondary); }
.hc-helpful-btn { background: transparent; border: 1px solid var(--ps-dark-elevated); border-radius: var(--radius-sm); padding: 6px 16px; font-size: 18px; cursor: pointer; transition: all 0.15s; }
.hc-helpful-btn:hover { background: var(--ps-gold-muted); border-color: var(--ps-gold-border); }
.hc-helpful-btn.selected { background: var(--ps-gold-muted); border-color: var(--ps-gold); }

.hc-category-view h2 { font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.hc-category-articles { display: flex; flex-direction: column; gap: 2px; }
.hc-category-article-item { padding: 18px 20px; background: var(--ps-dark-surface); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; font-weight: 500; }
.hc-category-article-item:hover { background: var(--ps-gold-muted); padding-left: 26px; }

/* ============================================================================
   CONTACT CTA
   ============================================================================ */

.hc-contact { background: var(--ps-dark-surface); border-top: 1px solid var(--ps-dark-elevated); padding: 50px 24px; }
.hc-contact-inner { max-width: 600px; margin: 0 auto; text-align: center; }
.hc-contact h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.hc-contact > .hc-contact-inner > p { color: var(--ps-text-secondary); margin-bottom: 20px; }
.hc-contact-details { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; font-size: 14px; color: var(--ps-text-muted); }

.hc-chat-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--ps-gold);
  color: var(--ps-black);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hc-chat-cta:hover { transform: scale(1.03); filter: brightness(1.1); }

/* ============================================================================
   FOOTER
   ============================================================================ */

.hc-footer { padding: 24px; text-align: center; font-size: 13px; color: var(--ps-text-muted); border-top: 1px solid rgba(255,255,255,0.04); }

/* ============================================================================
   CHAT PANEL
   ============================================================================ */

.chat-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 900; opacity: 0; transition: opacity 0.3s var(--ease); }
.chat-overlay.active { opacity: 1; }

.chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--chat-width); max-width: 100vw;
  background: var(--ps-black); border-left: 2px solid var(--ps-gold);
  z-index: 1000; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.35s var(--ease);
}

.chat-panel.open { transform: translateX(0); }

.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ps-dark-elevated); flex-shrink: 0; }
.header-left { display: flex; align-items: center; gap: 10px; }

.chat-header-logo { width: 32px; height: 32px; border-radius: 50%; }

.header-text h2 { font-size: 16px; font-weight: 600; line-height: 1.2; }
.ai-badge { font-size: 10px; font-weight: 600; color: var(--ps-gold); text-transform: uppercase; letter-spacing: 0.3px; }
.chat-header-actions { display: flex; align-items: center; gap: 8px; }

.new-chat-button { background: transparent; border: 1px solid var(--ps-gold-border); color: var(--ps-gold); padding: 6px 14px; border-radius: var(--radius-pill); font-family: var(--font); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.new-chat-button:hover { background: var(--ps-gold); color: var(--ps-black); }
.close-chat-btn { background: transparent; border: none; color: var(--ps-text-secondary); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); transition: color 0.15s; }
.close-chat-btn:hover { color: var(--ps-text); }

/* Region Selection */
.chat-region-selection { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 24px; }
.chat-region-prompt { font-size: 15px; color: var(--ps-text-secondary); margin-bottom: 20px; }
.chat-region-buttons { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }
.chat-region-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; background: var(--ps-dark-surface); border: 2px solid var(--ps-dark-elevated); border-radius: var(--radius-md); color: var(--ps-text); font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.chat-region-btn:hover { border-color: var(--ps-gold); background: var(--ps-gold-muted); }

/* Messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--ps-dark-elevated); border-radius: 2px; }

.message { display: flex; gap: 8px; max-width: 88%; animation: msgIn 0.25s ease-out; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }
@keyframes msgIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.message-avatar { width: 28px; height: 28px; flex-shrink: 0; }
.message-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.message.assistant .message-bubble { background: var(--ps-bot-bubble); color: var(--ps-text); border: 1px solid var(--ps-bot-border); border-top-left-radius: 4px; }
.message.user .message-bubble { background: var(--ps-user-bubble); color: var(--ps-text); border: 2px solid var(--ps-user-border); border-top-right-radius: 4px; }
.message-bubble-buttons-only { background: transparent!important; border: none!important; padding: 4px 0!important; }
.message-bubble a { color: var(--ps-gold); text-decoration: underline; }
.message-bubble strong { font-weight: 600; color: var(--ps-gold); }
.message-bubble ul, .message-bubble ol { margin: 6px 0 6px 18px; }
.message-bubble li { margin-bottom: 3px; }
.message-time { display: block; font-size: 10px; color: var(--ps-text-muted); margin-top: 4px; }
.message.user .message-time { text-align: right; }

.account-type-buttons { display: flex; gap: 8px; margin-top: 10px; }
.account-type-btn { padding: 10px 18px; border: 2px solid var(--ps-gold-border); border-radius: var(--radius-md); background: transparent; color: var(--ps-gold); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; flex: 1; min-height: 44px; }
.account-type-btn:hover { background: var(--ps-gold); color: var(--ps-black); }

.satisfaction-prompt { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.satisfaction-prompt p { font-size: 12px; color: var(--ps-text-secondary); }
.satisfaction-btn { background: transparent; border: 1px solid var(--ps-dark-elevated); border-radius: var(--radius-sm); padding: 4px 12px; font-size: 16px; cursor: pointer; transition: all 0.15s; }
.satisfaction-btn:hover { background: var(--ps-gold-muted); }
.satisfaction-btn.selected { border-color: var(--ps-gold); background: var(--ps-gold-muted); }

.system-message { text-align: center; color: var(--ps-text-muted); font-size: 12px; padding: 6px 14px; font-style: italic; }

/* Typing */
.typing-indicator { padding: 10px 18px; flex-shrink: 0; }
.typing-content { display: flex; align-items: center; gap: 8px; }
.typing-text { font-size: 12px; color: var(--ps-text-muted); }
.typing-dots { display: flex; gap: 3px; }
.typing-dots span { width: 5px; height: 5px; background: var(--ps-gold); border-radius: 50%; animation: bounce 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Input */
.chat-input-container { padding: 14px 18px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.input-wrapper { display: flex; align-items: flex-end; gap: 8px; background: var(--ps-input-bg); border: 2px solid var(--ps-input-border); border-radius: var(--radius-lg); padding: 3px 3px 3px 14px; transition: border-color 0.15s; }
.input-wrapper:focus-within { border-color: var(--ps-gold); }
#message-input { flex: 1; background: transparent; border: none; color: var(--ps-text); font-family: var(--font); font-size: 14px; line-height: 1.4; padding: 9px 0; resize: none; max-height: 100px; outline: none; }
#message-input::placeholder { color: var(--ps-text-muted); }
.send-button { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--ps-gold); color: var(--ps-black); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.send-button:hover:not(:disabled) { filter: brightness(1.1); }
.send-button:disabled { opacity: 0.3; cursor: not-allowed; }
.char-counter { font-size: 10px; color: var(--ps-text-muted); text-align: right; padding: 3px 6px 0; min-height: 14px; }
.char-counter.warning { color: var(--ps-error); }

/* Inactivity */
.inactivity-warning { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 100; }
.warning-content { background: var(--ps-dark-elevated); border: 1px solid var(--ps-gold-border); border-radius: var(--radius-md); padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); white-space: nowrap; }
.warning-content p { font-size: 13px; color: var(--ps-text-secondary); }
.warning-btn { background: var(--ps-gold); color: var(--ps-black); border: none; border-radius: var(--radius-pill); padding: 6px 14px; font-family: var(--font); font-size: 12px; font-weight: 600; cursor: pointer; }

/* ============================================================================
   FLOATING CHAT BUTTON
   ============================================================================ */

.chat-fab { position: fixed; bottom: 28px; right: 28px; width: 60px; height: 60px; border-radius: 50%; background: var(--ps-gold); color: var(--ps-black); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(255, 255, 0, 0.3); z-index: 800; transition: all 0.25s var(--ease); }
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(255, 255, 0, 0.4); }
.chat-fab.hidden { transform: scale(0); opacity: 0; pointer-events: none; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .hc-hero { padding: 40px 20px 30px; }
  .hc-hero h1 { font-size: 28px; }
  .hc-categories { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 20px 30px; }
  .hc-popular { padding: 0 20px 40px; }
  .hc-contact { padding: 40px 20px; }
  .hc-brand-logo { height: 26px; }
  .hc-brand-divider { font-size: 20px; }
  .hc-brand-text { font-size: 15px; }
  .chat-panel { width: 100vw; border-left: none; }
  .chat-fab { bottom: 20px; right: 20px; width: 54px; height: 54px; }
  .account-type-buttons { flex-direction: column; }
  .warning-content { flex-direction: column; text-align: center; white-space: normal; }
}

@media (max-width: 480px) {
  .hc-categories { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hc-category-card { padding: 20px 16px; }
  .hc-category-card h3 { font-size: 14px; }
  .hc-hero h1 { font-size: 24px; }
  .hc-brand-logo { height: 22px; }
}

@media (hover: none) and (pointer: coarse) {
  .chat-region-btn, .account-type-btn, .hc-chat-cta, .hc-popular-item, .hc-category-article-item { min-height: 48px; }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

*:focus-visible { outline: 2px solid var(--ps-gold); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
