/* ── AI Picks Views ──────────────────────────────────────────────────────── */

/* ── Chat UI ──────────────────────────────────────────────────────────────── */

.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 480px;
  max-width: 880px;
  margin: 0 auto;
  background: var(--elevated, #27272A);
  border: 1px solid var(--border, #3F3F46);
  border-radius: 14px;
  overflow: hidden;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #3F3F46);
  background: var(--bg, #09090B);
}
.ai-chat-title { display: flex; flex-direction: column; gap: 2px; }
.ai-chat-title > span:first-child {
  font-size: 1.05rem; font-weight: 800; color: var(--text, #FAFAFA);
}
.ai-chat-sub { font-size: 0.75rem; color: var(--text-muted, #71717A); }
.btn-chat-clear {
  background: transparent;
  border: 1px solid var(--border, #3F3F46);
  color: var(--text-sec, #A1A1AA);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all .15s;
}
.btn-chat-clear:hover { border-color: #EF4444; color: #EF4444; }

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-chat-welcome {
  text-align: center;
  color: var(--text-muted, #71717A);
  padding: 30px 20px;
  max-width: 560px;
  margin: auto;
}
.ai-chat-welcome-icon { font-size: 2.4rem; margin-bottom: 10px; }
.ai-chat-welcome-text { font-size: 0.92rem; line-height: 1.5; }
.ai-chat-welcome-text ul { text-align: left; display: inline-block; margin-top: 4px; padding-left: 18px; }
.ai-chat-welcome-text li { margin: 4px 0; }

.ai-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
}
.ai-msg--user { justify-content: flex-end; }
.ai-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ai-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text, #FAFAFA);
  max-width: min(680px, 78%);
  word-wrap: break-word;
  white-space: normal;
}
.ai-msg--user .ai-msg-bubble {
  background: var(--green, #22C55E);
  color: #000;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.ai-msg--assistant .ai-msg-bubble {
  background: var(--bg, #09090B);
  border: 1px solid var(--border, #3F3F46);
  border-bottom-left-radius: 4px;
}
.ai-msg--error .ai-msg-bubble {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.08);
  color: #FCA5A5;
}
.ai-msg-bubble strong { color: var(--green, #22C55E); }
.ai-msg-bubble code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}
.ai-msg-bubble ul { margin: 8px 0; padding-left: 20px; }
.ai-msg-bubble li { margin: 2px 0; }
.ai-msg-bubble a { color: #86EFAC; text-decoration: underline; }
.ai-msg-stats {
  font-size: 0.7rem;
  color: var(--text-muted, #71717A);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border, #3F3F46);
}

/* Typing indicator */
.ai-msg-bubble--typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.ai-msg-bubble--typing .dot {
  width: 6px; height: 6px;
  background: var(--text-muted, #71717A);
  border-radius: 50%;
  animation: chatpulse 1.2s infinite ease-in-out;
}
.ai-msg-bubble--typing .dot:nth-child(2) { animation-delay: .15s; }
.ai-msg-bubble--typing .dot:nth-child(3) { animation-delay: .30s; }
@keyframes chatpulse {
  0%, 60%, 100% { transform: scale(0.85); opacity: .4; }
  30% { transform: scale(1.15); opacity: 1; }
}

/* Input row */
.ai-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--bg, #09090B);
  border-top: 1px solid var(--border, #3F3F46);
  align-items: flex-end;
}
.ai-chat-input {
  flex: 1;
  background: var(--elevated, #27272A);
  border: 1px solid var(--border, #3F3F46);
  color: var(--text, #FAFAFA);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  max-height: 160px;
  line-height: 1.4;
}
.ai-chat-input:focus { outline: none; border-color: var(--green, #22C55E); }
.ai-chat-input:disabled { opacity: 0.6; }
.ai-chat-send {
  background: var(--green, #22C55E);
  color: #000;
  border: none;
  border-radius: 10px;
  width: 44px; height: 42px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  transition: all .15s;
  flex-shrink: 0;
}
.ai-chat-send:hover:not(:disabled) { background: #16A34A; transform: translateY(-1px); }
.ai-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
  .ai-chat-container { height: calc(100vh - 130px); border-radius: 0; }
  .ai-msg-bubble { max-width: 86%; }
}

/* Prompt panel (conversational) */
.ai-prompt-panel {
  background: var(--elevated, #27272A);
  border: 1px solid var(--border, #3F3F46);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}
.ai-prompt-label {
  font-weight: 700;
  color: var(--text, #FAFAFA);
  font-size: 0.95rem;
}
.ai-prompt-panel textarea {
  background: var(--bg, #09090B);
  border: 1px solid var(--border, #3F3F46);
  color: var(--text, #FAFAFA);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
}
.ai-prompt-panel textarea:focus {
  outline: none;
  border-color: var(--green, #22C55E);
}
.ai-prompt-actions { display: flex; justify-content: flex-end; }

/* Bet365 edge pills inside a pick card */
.pick-edge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.edge-pill {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border, #3F3F46);
  background: var(--bg, #09090B);
  color: var(--text-sec, #A1A1AA);
}
.edge-pill--bet365 { border-color: #FFD700; color: #FCD34D; }
.edge-pill--avg    { border-color: var(--border); }
.edge-pill--edge   { background: rgba(34, 197, 94, 0.15); border-color: #22C55E; color: #86EFAC; }

/* Highlight Bet365 row inside the odds list */
.odds-item--ref { border-color: #FFD700 !important; }
.odds-item--ref .odds-book { color: #FCD34D; font-weight: 700; }

/* Key factors list */
.pick-factors { margin-top: 10px; }
.pick-factors-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #71717A);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.pick-factors ul { margin: 0; padding-left: 18px; }
.pick-factors li { font-size: 0.85rem; color: var(--text-sec, #A1A1AA); margin: 2px 0; }

/* Warning footer */
.pick-warning {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #EF4444;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #FCA5A5;
}

/* Scan stats line */
.ai-stats-line {
  font-size: 0.78rem;
  color: var(--text-muted, #71717A);
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--bg, #09090B);
  border-radius: 6px;
  border: 1px dashed var(--border, #3F3F46);
}

/* Correct Score section */
.cs-section { margin-top: 24px; display: grid; gap: 14px; }
.cs-header { padding: 0 4px; }
.cs-title { font-size: 1rem; font-weight: 800; color: var(--text, #FAFAFA); }
.cs-sub { font-size: 0.8rem; color: var(--text-muted, #71717A); margin-top: 2px; }
.cs-game {
  background: var(--elevated, #27272A);
  border: 1px solid var(--border, #3F3F46);
  border-radius: 12px;
  padding: 12px 14px;
}
.cs-game-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cs-game-title strong { color: var(--text, #FAFAFA); font-size: 0.92rem; }
.cs-game-league { font-size: 0.72rem; color: var(--text-muted, #71717A); text-transform: uppercase; }
.cs-table-wrap { overflow-x: auto; }
.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.cs-table th, .cs-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border, #3F3F46);
  text-align: center;
}
.cs-table th {
  color: var(--text-muted, #71717A);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
  background: var(--bg, #09090B);
}
.cs-table .cs-score { font-weight: 800; color: var(--text, #FAFAFA); text-align: left; }
.cs-table tr:hover { background: var(--bg, #09090B); }

/* Original styles ↓ */

.ai-picks-container {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.ai-picks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ai-picks-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text, #FAFAFA);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-picks-refresh {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-refresh-ai {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-refresh-ai:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-refresh-ai:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.refresh-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-picks-list {
  display: grid;
  gap: 12px;
}

.ai-pick-card {
  background: var(--elevated, #27272A);
  border: 1px solid var(--border, #3F3F46);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

.ai-pick-card:hover {
  border-color: var(--green, #22C55E);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.pick-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.pick-game {
  font-weight: 700;
  color: var(--text, #FAFAFA);
  font-size: 0.95rem;
}

.pick-league {
  font-size: 0.7rem;
  color: var(--text-muted, #71717A);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pick-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rating-emoji {
  font-size: 1.5rem;
}

.rating-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green, #22C55E);
}

.pick-selection {
  background: var(--surface, #18181B);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.selection-bet {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #FAFAFA);
  margin-bottom: 4px;
}

.selection-type {
  font-size: 0.75rem;
  color: var(--text-muted, #71717A);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pick-odds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.odds-item {
  background: var(--bg, #09090B);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #3F3F46);
}

.odds-book {
  font-size: 0.75rem;
  color: var(--text-muted, #71717A);
  margin-bottom: 4px;
}

.odds-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green, #22C55E);
}

.pick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg, #09090B);
  border-radius: 8px;
}

.stat {
  font-size: 0.8rem;
}

.stat-label {
  color: var(--text-muted, #71717A);
  margin-bottom: 2px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  color: var(--text, #FAFAFA);
  font-weight: 700;
}

.pick-reasoning {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-sec, #A1A1AA);
  border-left: 2px solid var(--green, #22C55E);
  padding-left: 12px;
  margin-bottom: 12px;
}

.pick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.75rem;
  border: 1px solid var(--border, #3F3F46);
  background: none;
  color: var(--text-sec, #A1A1AA);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
}

.btn-small:hover {
  background: var(--surface, #18181B);
  border-color: var(--green, #22C55E);
  color: var(--green, #22C55E);
}

.picks-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #71717A);
}

.picks-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.picks-empty-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.rate-limit-msg {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #FCA5A5;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.pick-time {
  font-size: 0.7rem;
  color: var(--text-muted, #71717A);
  margin-top: 8px;
}

/* ── Chat pick-tracking chips ───────────────────────────────────────────── */

.ai-pick-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.ai-pick-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: rgba(34, 197, 94, .07);
  border: 1px solid rgba(34, 197, 94, .25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .78rem;
  color: var(--text, #FAFAFA);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .15s, border-color .15s;
  line-height: 1.4;
}

.ai-pick-chip:hover {
  background: rgba(34, 197, 94, .14);
  border-color: rgba(34, 197, 94, .5);
}

.ai-pick-chip__cta {
  margin-left: auto;
  color: var(--green, #22C55E);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
