/* =============================================
   BetPro Analytics — Premium Dark Theme
   ============================================= */

:root {
  --bg-primary:    #08080f;
  --bg-secondary:  #10101c;
  --bg-card:       #17172a;
  --bg-card-hover: #1e1e35;
  --sidebar-w:     265px;
  --purple:        #7c3aed;
  --purple-light:  #a78bfa;
  --gold:          #f59e0b;
  --gold-light:    #fcd34d;
  --green:         #10b981;
  --red:           #ef4444;
  --blue:          #3b82f6;
  --orange:        #f97316;
  --text-primary:  #e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --border:        rgba(255,255,255,0.07);
  --border-focus:  rgba(124,58,237,0.6);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0; top: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius:4px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 16px rgba(124,58,237,.4);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.25rem; font-weight: 900;
  background: linear-gradient(135deg, var(--purple-light), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.brand-sub {
  font-size: .65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 2px;
}

.sidebar-nav { flex: 1; padding: 14px 10px; }

.nav-section-label {
  font-size: .6rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 2px; padding: 8px 10px 4px;
  text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: var(--text-secondary);
  font-size: .84rem; font-weight: 500;
  transition: all .2s ease; margin: 1px 0;
  position: relative;
}

.nav-item:hover {
  background: rgba(124,58,237,.12);
  color: var(--text-primary);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(124,58,237,.3), rgba(245,158,11,.1));
  color: white;
  border: 1px solid rgba(124,58,237,.35);
  box-shadow: 0 2px 12px rgba(124,58,237,.2);
}

.nav-item i { font-size: .95rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }

.nav-badge {
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: .6rem; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
  letter-spacing: .5px;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-info { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; flex-shrink: 0;
}

.user-name { font-size: .82rem; font-weight: 600; }
.user-role { font-size: .68rem; color: var(--text-muted); }

.sidebar-overlay {
  display: none; position: fixed;
  inset: 0; z-index: 190;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

.app-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px);
}

.sidebar-toggle {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px; padding: 6px 10px;
  cursor: pointer; font-size: 1.1rem;
  transition: all .2s; display: none;
}

.sidebar-toggle:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }

.header-title {
  flex: 1; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}

.header-title i { color: var(--purple-light); }

.header-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: var(--text-secondary);
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.15);
  padding: 5px 12px; border-radius: 20px;
}

/* ============ TAB SYSTEM ============ */
.tab-content { flex: 1; padding: 24px 28px; }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeSlide .35s ease; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ MODEL HEADER ============ */
.model-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}

.model-icon {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.model-icon-purple  { background: linear-gradient(135deg, #6d28d9, #7c3aed); box-shadow: 0 4px 16px rgba(124,58,237,.35); }
.model-icon-gold    { background: linear-gradient(135deg, #b45309, #d97706); box-shadow: 0 4px 16px rgba(245,158,11,.3); }
.model-icon-blue    { background: linear-gradient(135deg, #1d4ed8, #3b82f6); box-shadow: 0 4px 16px rgba(59,130,246,.3); }
.model-icon-green   { background: linear-gradient(135deg, #047857, #10b981); box-shadow: 0 4px 16px rgba(16,185,129,.3); }
.model-icon-orange  { background: linear-gradient(135deg, #c2410c, #f97316); box-shadow: 0 4px 16px rgba(249,115,22,.3); }
.model-icon-red     { background: linear-gradient(135deg, #b91c1c, #ef4444); box-shadow: 0 4px 16px rgba(239,68,68,.3); }
.model-icon-lightning { background: linear-gradient(135deg, var(--purple), var(--gold)); box-shadow: 0 4px 16px rgba(124,58,237,.3); }

.model-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 4px; }
.model-desc  { color: var(--text-secondary); font-size: .88rem; margin: 0; }

/* ============ GRID LAYOUTS ============ */
.row-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px; margin-bottom: 20px;
}

.three-col-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* ============ CARDS ============ */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 20px;
  transition: border-color .2s;
}

.form-card:hover { border-color: rgba(124,58,237,.2); }

.card-title {
  font-size: .92rem; font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}

.card-title i { color: var(--purple-light); }

/* ============ INPUTS ============ */
.input-group-custom { margin-bottom: 14px; }

.input-group-custom label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .5px;
}

.input-field {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  color: var(--text-primary);
  font-size: .9rem; font-family: 'Inter', sans-serif;
  transition: all .2s; outline: none;
  -webkit-appearance: none;
}

.input-field:hover { border-color: rgba(255,255,255,.12); }

.input-field:focus {
  border-color: var(--purple);
  background: rgba(124,58,237,.07);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

.input-large {
  padding: 13px 14px; font-size: 1.05rem;
  font-weight: 700; text-align: center;
  letter-spacing: .5px; color: var(--gold);
}

.input-hint { font-size: .7rem; color: var(--text-muted); display: block; margin-top: 3px; }

.text-muted-custom { color: var(--text-muted); font-size: .84rem; margin-bottom: 14px; }
.text-muted-custom code { background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 4px; font-size: .82rem; }

/* ============ BUTTONS ============ */
.btn-analyze {
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: white; border: none; border-radius: 12px;
  padding: 13px 36px; font-size: .96rem; font-weight: 700;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all .3s; display: inline-flex;
  align-items: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(124,58,237,.4);
}

.btn-analyze:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,.5); }
.btn-analyze:active { transform: translateY(0); }

.btn-gold    { background: linear-gradient(135deg, #b45309, var(--gold)); box-shadow: 0 4px 20px rgba(245,158,11,.3); }
.btn-gold:hover { box-shadow: 0 8px 30px rgba(245,158,11,.4); }
.btn-blue    { background: linear-gradient(135deg, #1d4ed8, var(--blue)); box-shadow: 0 4px 20px rgba(59,130,246,.3); }
.btn-blue:hover { box-shadow: 0 8px 30px rgba(59,130,246,.4); }
.btn-green   { background: linear-gradient(135deg, #047857, var(--green)); box-shadow: 0 4px 20px rgba(16,185,129,.3); }
.btn-green:hover { box-shadow: 0 8px 30px rgba(16,185,129,.4); }
.btn-orange  { background: linear-gradient(135deg, #c2410c, var(--orange)); box-shadow: 0 4px 20px rgba(249,115,22,.3); }
.btn-orange:hover { box-shadow: 0 8px 30px rgba(249,115,22,.4); }
.btn-red     { background: linear-gradient(135deg, #b91c1c, var(--red)); box-shadow: 0 4px 20px rgba(239,68,68,.3); }
.btn-red:hover { box-shadow: 0 8px 30px rgba(239,68,68,.4); }
.btn-lightning { background: linear-gradient(135deg, var(--purple), var(--gold)); box-shadow: 0 4px 20px rgba(124,58,237,.3); }
.btn-lightning:hover { box-shadow: 0 8px 30px rgba(124,58,237,.45); }

.btn-clear {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25);
  color: var(--red); border-radius: 10px;
  padding: 8px 16px; font-size: .82rem; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
}
.btn-clear:hover { background: rgba(239,68,68,.2); }

.text-center { text-align: center; }

/* ============ INFO BOX ============ */
.info-box {
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 10px; padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .84rem; color: var(--purple-light);
}
.info-box i { flex-shrink: 0; margin-top: 2px; }

.viability-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  background: rgba(255,255,255,.03);
  border-radius: 10px; padding: 12px 16px;
  margin-top: 16px;
}

.vl-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-secondary); }
.vl-dot { width: 10px; height: 10px; border-radius: 50%; display: block; flex-shrink: 0; }

/* ============ RESULT CONTAINER ============ */
.result-container { animation: fadeSlide .4s ease; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  max-width: 900px; margin: 24px auto 0;
}

.result-header {
  padding: 18px 24px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}

.result-header.success { background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(16,185,129,.04)); border-bottom: 1px solid rgba(16,185,129,.2); }
.result-header.warning { background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.04)); border-bottom: 1px solid rgba(245,158,11,.2); }
.result-header.danger  { background: linear-gradient(135deg, rgba(239,68,68,.18), rgba(239,68,68,.04)); border-bottom: 1px solid rgba(239,68,68,.2); }

.result-badge {
  font-size: .72rem; font-weight: 800;
  padding: 5px 14px; border-radius: 20px;
  letter-spacing: .8px; text-transform: uppercase;
  white-space: nowrap; flex-shrink: 0;
}

.badge-success { background: rgba(16,185,129,.18); color: var(--green); border: 1px solid rgba(16,185,129,.3); }
.badge-warning { background: rgba(245,158,11,.18); color: var(--gold); border: 1px solid rgba(245,158,11,.3); }
.badge-danger  { background: rgba(239,68,68,.18); color: var(--red); border: 1px solid rgba(239,68,68,.3); }

.result-body { padding: 20px 24px; }

/* ============ CHECK ITEMS ============ */
.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .87rem;
}

.check-item:last-child { border-bottom: none; }

.check-icon-ok      { color: var(--green); font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }
.check-icon-fail    { color: var(--red);   font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }
.check-icon-warn    { color: var(--gold);  font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }

.check-text { flex: 1; }
.check-label { font-weight: 600; color: var(--text-primary); }
.check-value { color: var(--text-secondary); font-size: .78rem; margin-top: 2px; line-height: 1.4; }

/* ============ METRICS GRID ============ */
.metrics-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 20px;
}

.metric-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; text-align: center;
}

.metric-value { font-size: 1.75rem; font-weight: 900; line-height: 1; margin-bottom: 5px; }
.metric-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ============ PROGRESS BAR ============ */
.progress-bar-custom {
  background: rgba(255,255,255,.07);
  border-radius: 8px; height: 7px; overflow: hidden;
}

.progress-fill {
  height: 100%; border-radius: 8px;
  transition: width .9s cubic-bezier(.4,0,.2,1);
}

.progress-fill.green  { background: linear-gradient(90deg, #047857, var(--green)); }
.progress-fill.gold   { background: linear-gradient(90deg, #b45309, var(--gold)); }
.progress-fill.red    { background: linear-gradient(90deg, #b91c1c, var(--red)); }
.progress-fill.purple { background: linear-gradient(90deg, #5b21b6, var(--purple-light)); }
.progress-fill.blue   { background: linear-gradient(90deg, #1d4ed8, var(--blue)); }
.progress-fill.orange { background: linear-gradient(90deg, #c2410c, var(--orange)); }

/* ============ ODDS DISPLAY ============ */
.odds-display {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; margin: 14px 0;
}

.odd-box {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; text-align: center;
}

.odd-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.odd-value { font-size: 1.5rem; font-weight: 900; color: var(--gold); }
.odd-implied { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }

/* ============ GAUGE ============ */
.margin-gauge {
  background: rgba(255,255,255,.03);
  border-radius: 12px; padding: 18px; margin: 16px 0;
}

.gauge-bar-wrapper {
  position: relative; height: 18px;
  background: linear-gradient(90deg,
    var(--green) 0%, var(--green) 30%,
    var(--gold) 30%, var(--gold) 60%,
    var(--red) 60%, var(--red) 100%);
  border-radius: 9px; overflow: visible;
  margin: 12px 0;
}

.gauge-indicator {
  position: absolute; top: -5px;
  width: 4px; height: 28px;
  background: white; border-radius: 2px;
  box-shadow: 0 0 10px rgba(255,255,255,.9), 0 0 20px rgba(255,255,255,.4);
  transition: left .9s cubic-bezier(.4,0,.2,1);
  transform: translateX(-50%);
}

/* ============ ALERT BOXES ============ */
.alert-box {
  border-radius: 10px; padding: 13px 16px; margin: 14px 0;
  display: flex; align-items: flex-start; gap: 10px; font-size: .86rem;
}

.alert-box.info { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.2); color: #93c5fd; }
.alert-box.tip  { background: rgba(124,58,237,.1); border: 1px solid rgba(124,58,237,.2); color: #c4b5fd; }
.alert-box.warn { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.2); color: #fde68a; }
.alert-box.bad  { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2);  color: #fca5a5; }

.alert-box i { flex-shrink: 0; margin-top: 2px; }

/* ============ SHOT PERCENTAGE CIRCLES ============ */
.shot-circle-wrap { text-align: center; padding: 20px; }

.big-percent {
  font-size: 3.5rem; font-weight: 900; line-height: 1;
  margin-bottom: 4px;
}

/* ============ FORMULA BOX ============ */
.formula-box {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; margin-top: 14px;
}

.formula-title {
  font-size: .68rem; color: var(--text-muted); font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px;
}

.formula-code { font-size: .8rem; color: var(--purple-light); line-height: 1.8; font-family: monospace; }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center; padding: 70px 20px; color: var(--text-muted);
}

.empty-state i { font-size: 3.5rem; display: block; margin-bottom: 16px; }
.empty-state p { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state span { font-size: .84rem; }

/* ============ HISTORY ============ */
.history-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all .2s;
}

.history-item:hover {
  border-color: rgba(124,58,237,.3);
  background: var(--bg-card-hover);
  transform: translateX(3px);
}

/* ============ SECTION PANELS ============ */
.section-panel {
  background: rgba(255,255,255,.025);
  border-radius: 12px; padding: 18px; margin-bottom: 14px;
}

/* ============ VERDICT BOX ============ */
.verdict-box {
  border-radius: 14px; padding: 20px 24px;
  text-align: center; margin-top: 16px; margin-bottom: 4px;
}

.verdict-box.vb-success { background: rgba(16,185,129,.1); border: 2px solid rgba(16,185,129,.25); }
.verdict-box.vb-warning { background: rgba(245,158,11,.1); border: 2px solid rgba(245,158,11,.25); }
.verdict-box.vb-danger  { background: rgba(239,68,68,.1); border: 2px solid rgba(239,68,68,.25); }

.verdict-number { font-size: 4rem; font-weight: 900; line-height: 1; }
.verdict-label  { font-size: 1rem; font-weight: 700; margin: 8px 0 4px; }
.verdict-sub    { font-size: .8rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
}

@media (max-width: 700px) {
  .row-grid { grid-template-columns: 1fr; }
  .three-col-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .odds-display { grid-template-columns: 1fr 1fr 1fr; }
  .tab-content { padding: 16px; }
  .result-body { padding: 14px 16px; }
  .model-title { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .odds-display { grid-template-columns: 1fr; }
  .header-badge span { display: none; }
}
