/* BetsMetric Dashboard — Brand color #3E5866 */
:root {
  --bg: #121418;
  --bg-card: #1a1e24;
  --bg-elevated: #22262e;
  --border: #2a2e36;
  --text: #ffffff;
  --text-muted: #8a8e96;
  --brand: #3E5866;
  --brand-dim: rgba(62, 88, 102, 0.25);
  --brand-light: #4d6b7a;
  --neon-green: #39ff14;
  --electric-blue: #4A90E2;
  --electric-blue-dim: rgba(74, 144, 226, 0.2);
  --purple: #7c3aed;
  --red: #ef4444;
}

* { box-sizing: border-box; }

body.dashboard {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Top Navigation */
.dashboard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  transform-origin: center;
  animation: owlFloat 3.5s ease-in-out infinite;
}

.owl-logo:hover .logo-img {
  animation-duration: 1.2s;
  transform: rotate(-8deg) scale(1.08);
}

@keyframes owlFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.nav-menu {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  position: relative;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text); }

.nav-link.active {
  color: var(--brand-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulseDot 1.2s ease-in-out infinite;
}

.live-toggle.paused .live-dot {
  background: var(--red);
  box-shadow: none;
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
  text-decoration: none;
}

.user-avatar:hover {
  color: var(--text);
  border-color: var(--brand);
}

.user-avatar svg { width: 20px; height: 20px; }

.nav-dropdown {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-dropdown:hover { color: var(--text); }

.nav-dropdown svg { width: 20px; height: 20px; }

/* Predictions-only layout */
.predictions-only .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-nav .nav-link {
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s;
}

.header-nav .nav-link:hover { color: var(--text); }
.header-nav .nav-link.active { color: var(--brand-light); }

.telegram-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
  color: white !important;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.telegram-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
}

.predictions-only .page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.predictions-only .page-date {
  font-weight: 400;
  color: var(--text-muted);
}

.predictions-main {
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Filters */
.filters-section {
  background: #121620;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.filters-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.filter-group select {
  padding: 0.5rem 0.75rem;
  min-width: 130px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.filter-reset {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: auto;
}

.filter-reset:hover {
  color: var(--text);
  border-color: var(--brand);
}

/* Stats bar / History */
.stats-bar {
  background: #121620;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.stats-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.stat-value.positive { color: #4ade80; }
.stat-value.negative { color: #f87171; }

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-details {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.history-details summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-light);
}

.history-list {
  margin-top: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 0.85rem;
}

.history-item.win { border-left: 3px solid #4ade80; }
.history-item.loss { border-left: 3px solid #f87171; }

.history-match { font-weight: 600; flex: 1 1 100%; }
.history-meta { color: var(--text-muted); }
.history-result { font-weight: 600; }
.history-item.win .history-result { color: #4ade80; }
.history-item.loss .history-result { color: #f87171; }

.history-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

/* Odds compare */
.card-odds-compare {
  margin-top: 0.75rem;
}

.odds-compare-btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.odds-compare-btn:hover {
  color: var(--text);
  border-color: var(--brand);
}

.odds-compare-list {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.odds-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.odds-row .best { color: var(--neon-green); font-weight: 700; }

/* Card markets (BTTS, O/U) */
.card-markets { margin-top: 0.5rem; }

.markets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.market-tag {
  padding: 0.35rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.market-tag strong { color: var(--text); }

/* Place bet button */
.card-bet-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-bet-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--brand-dim);
}

/* Place bet modal */
.place-bet-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  min-width: 320px;
}

.place-bet-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.place-bet-modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.modal-match {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-light);
  margin-bottom: 1rem;
}

.modal-field {
  margin-bottom: 1rem;
}

.modal-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.modal-field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.modal-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn:hover { opacity: 0.9; }

.modal-btn.win {
  background: #22c55e;
  color: white;
}

.modal-btn.loss {
  background: #ef4444;
  color: white;
}

.modal-btn.cancel {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

/* Telegram section */
.telegram-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.telegram-card {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.15) 0%, rgba(34, 158, 217, 0.08) 100%);
  border: 1px solid rgba(0, 136, 204, 0.3);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.telegram-icon {
  color: #229ED9;
  margin-bottom: 1rem;
}

.telegram-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.telegram-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.telegram-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.4);
}

/* Stake Calculator */
.stake-calculator {
  background: #121620;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calculator-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

.calc-subtitle {
  font-weight: 400;
  color: var(--text-muted);
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calc-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.calc-field input,
.calc-field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.calc-field input:focus,
.calc-field select:focus {
  outline: none;
  border-color: var(--brand);
}

.calc-results {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.calc-result {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.result-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.result-value.positive { color: #4ade80; }
.result-value.negative { color: #f87171; }

.odds-value.predicted { cursor: pointer; }
.odds-value.predicted:hover { opacity: 0.9; }

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* Sidebars */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
  overflow-y: auto;
}

.sidebar.right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.sidebar-section {
  margin-bottom: 2rem;
}

/* League Chips */
.league-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.league-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.league-chip:hover {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.league-chip.active {
  border-color: var(--brand);
  background: var(--brand-dim);
  color: var(--brand-light);
}

.league-icon { font-size: 1.25rem; }

/* Live Matches */
.live-list { display: flex; flex-direction: column; gap: 0.5rem; }

.live-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.live-item:hover {
  border-color: var(--brand);
}

.live-league {
  font-size: 0.7rem;
  color: var(--text-muted);
  grid-column: 1;
}

.live-teams {
  font-size: 0.9rem;
  font-weight: 500;
  grid-column: 1;
}

.live-score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--neon-green);
  grid-row: 1 / -1;
  grid-column: 2;
  align-self: center;
}

.live-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  background: var(--red);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  grid-row: 1 / -1;
  grid-column: 3;
  align-self: center;
}

/* Main Content */
.dashboard-main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  min-width: 0;
}

.main-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.main-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.main-info {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-info:hover { color: var(--text); }

.main-filter {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Value Cards Grid */
.value-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.value-card {
  background: #121620;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.25s;
  cursor: default;
}

.value-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.team-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-teams {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.card-section {
  margin-bottom: 1rem;
}

.card-section:last-child { margin-bottom: 0; }

.section-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-chart-probability {
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
}

.card-chart-probability svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-odds {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.odds-value {
  flex: 1;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  min-width: 0;
}

.odds-value.predicted {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
}

.odds-vs {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.confidence-bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #4ade80);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Right Sidebar - Quick Insights */
.insights-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.insight-item:hover {
  border-color: var(--brand);
}

.insight-item.trend .insight-icon { color: #eab308; }
.insight-item.alert .insight-icon { color: var(--red); }

.insight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.insight-content p {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.insight-content time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
  .sidebar.right { display: none; }
}

@media (max-width: 900px) {
  .sidebar.left { display: none; }
  .nav-menu { display: none; }
  .value-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 600px) {
  .dashboard-main { padding: 1rem; }
  .value-cards { grid-template-columns: 1fr; }
}

.predictions-only .value-cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 600px) {
  .predictions-main { padding: 1rem; }
  .predictions-only .page-header { flex-direction: column; align-items: flex-start; }
  .header-right { flex-direction: column; align-items: flex-start; }
  .filters-row { flex-direction: column; }
  .filter-reset { margin-left: 0; }
}
