/* =============================================
   BetPro Analytics — Premium Dark Theme
   ============================================= */

:root {
  /* Dark Slate Wager Theme */
  --bg-primary:    #0f172a;  /* Slate 900 */
  --bg-secondary:  #1e293b;  /* Slate 800 */
  --bg-card:       rgba(30, 41, 59, 0.55);
  --bg-card-hover: rgba(51, 65, 85, 0.65);
  --sidebar-w:     265px;
  
  --purple:        #3b82f6;  /* Electric Blue */
  --purple-light:  #60a5fa;  
  --gold:          #facc15;  /* Wager Gold/Yellow */
  --gold-light:    #fef08a;
  --green:         #22c55e;  /* Success Green */
  --green-light:   #4ade80;
  --red:           #ef4444;  /* Alert Red */
  --red-light:     #f87171;
  --blue:          #0ea5e9;
  --blue-light:    #38bdf8;
  --orange:        #f97316;
  
  --text-primary:  #f8fafc;  /* Slate 50 */
  --text-secondary:#cbd5e1;  /* Slate 300 */
  --text-muted:    #94a3b8;  /* Slate 400 */
  --border:        #334155;  /* Slate 700 */
  --border-focus:  rgba(59, 130, 246, 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;
  position: relative;
}

/* Magic UI: Orbes de luz en el fondo para potenciar el Glassmorphism */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}
body::before {
  width: 500px; height: 500px;
  background: var(--purple);
  top: -150px; left: -150px;
}
body::after {
  width: 400px; height: 400px;
  background: var(--blue);
  bottom: -100px; right: -100px;
}

h1, h2, h3, h4, h5, h6, .brand-name, .header-title, .model-title, .metric-value, .odd-value, .big-percent {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
}

.input-large, .nav-section-label, .result-badge, .formula-code {
  font-family: 'JetBrains Mono', monospace;
}

/* ============ 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; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.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: 10px 14px; border-radius: 12px;
  text-decoration: none; color: var(--text-secondary);
  font-size: .86rem; font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); margin: 3px 0;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%; width: 3px;
  background: var(--purple-light);
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: all 0.3s;
}

.nav-item:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item:hover::before {
  opacity: 0.5;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(245, 158, 11, 0.05));
  color: white;
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

.nav-item.active::before {
  opacity: 1;
  height: 50%;
  top: 25%;
}

.nav-item i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; transition: transform 0.2s; }
.nav-item:hover i { transform: scale(1.1); }
.nav-item span:first-of-type { flex: 1; }

.nav-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: .62rem; font-weight: 700;
  padding: 2px 7px; border-radius: 6px;
  letter-spacing: .5px;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.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;
  min-width: 0;
  max-width: 100%;
}

.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;
}

.header-actions {
  display: flex; align-items: center; gap: 8px;
}

/* ============ 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: 20px;
  margin-bottom: 28px; flex-wrap: wrap;
}

.model-icon {
  width: 58px; height: 58px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
  position: relative;
}
.model-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: inherit;
  filter: blur(8px);
  opacity: 0.4;
  z-index: -1;
}

.model-icon-purple  { background: linear-gradient(135deg, #6d28d9, #8b5cf6); box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4); }
.model-icon-gold    { background: linear-gradient(135deg, #b45309, #f59e0b); box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35); }
.model-icon-blue    { background: linear-gradient(135deg, #1d4ed8, #3b82f6); box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35); }
.model-icon-green   { background: linear-gradient(135deg, #047857, #10b981); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35); }
.model-icon-orange  { background: linear-gradient(135deg, #c2410c, #f97316); box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35); }
.model-icon-red     { background: linear-gradient(135deg, #b91c1c, #f43f5e); box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35); }
.model-icon-lightning { background: linear-gradient(135deg, #8b5cf6, #f59e0b); box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35); }
.model-icon-cyan      { background: linear-gradient(135deg, #0891b2, #06b6d4); box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35); }

.model-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 5px; letter-spacing: -0.5px; }
.model-desc  { color: var(--text-secondary); font-size: .9rem; margin: 0; line-height: 1.4; }

/* ============ GRID LAYOUTS ============ */
.row-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 24px;
}

.three-col-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.market-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.market-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ============ CARDS ============ */
.form-card {
  background: rgba(20, 20, 35, 0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px; padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.form-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent, rgba(255,255,255,0.03));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.form-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15), 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: .95rem; font-weight: 700;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary);
  letter-spacing: .3px;
}

.card-title i { color: var(--purple-light); font-size: 1.1rem; }

/* ============ INPUTS ============ */
.input-group-custom { margin-bottom: 16px; }

.input-group-custom label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .8px;
}

.input-field {
  width: 100%;
  background: rgba(8, 8, 17, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 11px 15px;
  color: var(--text-primary);
  font-size: .92rem; font-family: 'Inter', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); outline: none;
  -webkit-appearance: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.input-field:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(8, 8, 17, 0.7);
}

.input-field:focus {
  border-color: var(--purple-light);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), inset 0 2px 4px rgba(0,0,0,0.1);
}

select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 36px;
}

.input-wrapper-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrapper-icon .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.3s ease;
  z-index: 10;
}

.input-wrapper-icon .input-field {
  padding-left: 38px;
}

.input-wrapper-icon .input-field:focus + .input-icon {
  color: var(--purple-light);
}

.input-large {
  padding: 13px 15px; font-size: 1.1rem;
  font-weight: 800; text-align: center;
  letter-spacing: .5px; color: var(--gold-light);
}

.input-large:focus {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.05);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), inset 0 2px 4px rgba(0,0,0,0.1);
}

.input-hint { font-size: .72rem; color: var(--text-muted); display: block; margin-top: 5px; }

.text-muted-custom { color: var(--text-muted); font-size: .84rem; margin-bottom: 16px; }
.text-muted-custom code { background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 4px; font-size: .82rem; }

/* ============ BUTTONS ============ */
.btn-analyze {
  position: relative;
  background: linear-gradient(135deg, var(--purple) 0%, #6d28d9 100%);
  color: white; border: none; border-radius: 14px;
  padding: 14px 40px; font-size: .98rem; font-weight: 700;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); display: inline-flex;
  align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  overflow: hidden;
}

.btn-analyze::after {
  content: '';
  position: absolute;
  top: 0; left: -50%; width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-20deg);
  transition: 0.75s;
  opacity: 0;
}

.btn-analyze:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.6);
  filter: brightness(1.1);
}

.btn-analyze:hover::after {
  left: 120%;
  opacity: 1;
}

.btn-analyze:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-gold    { background: linear-gradient(135deg, #b45309, var(--gold)); box-shadow: 0 6px 20px rgba(245,158,11,.25); }
.btn-gold:hover { box-shadow: 0 10px 25px rgba(245,158,11,.4); }
.btn-blue    { background: linear-gradient(135deg, #1d4ed8, var(--blue)); box-shadow: 0 6px 20px rgba(59,130,246,.25); }
.btn-blue:hover { box-shadow: 0 10px 25px rgba(59,130,246,.4); }
.btn-green   { background: linear-gradient(135deg, #047857, var(--green)); box-shadow: 0 6px 20px rgba(16,185,129,.25); }
.btn-green:hover { box-shadow: 0 10px 25px rgba(16,185,129,.4); }
.btn-orange  { background: linear-gradient(135deg, #c2410c, var(--orange)); box-shadow: 0 6px 20px rgba(249,115,22,.25); }
.btn-orange:hover { box-shadow: 0 10px 25px rgba(249,115,22,.4); }
.btn-red     { background: linear-gradient(135deg, #b91c1c, var(--red)); box-shadow: 0 6px 20px rgba(239,68,68,.25); }
.btn-red:hover { box-shadow: 0 10px 25px rgba(239,68,68,.4); }
.btn-lightning { background: linear-gradient(135deg, var(--purple), var(--gold)); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25); }
.btn-lightning:hover { box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4); }

.btn-clear {
  background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.25);
  color: var(--red); border-radius: 12px;
  padding: 9px 18px; font-size: .84rem; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.btn-clear:hover { background: rgba(244, 63, 94, 0.18); border-color: rgba(244, 63, 94, 0.4); }

.btn-import {
  background: linear-gradient(135deg, #8b5cf6, #4f46e5);
  border: none; color: #fff; border-radius: 12px;
  padding: 9px 15px; font-size: .88rem; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-import:hover {
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.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: rgba(20, 20, 35, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px; overflow: hidden;
  max-width: 900px; margin: 28px auto 0;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(15px);
}

.result-card.animate-reveal {
  animation: resultReveal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes resultReveal {
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  padding: 20px 28px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
}

.result-header.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.02));
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  position: relative;
}
.result-header.success::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--green);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.6);
}

.result-header.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.02));
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  position: relative;
}
.result-header.warning::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.6);
}

.result-header.danger {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(244, 63, 94, 0.02));
  border-bottom: 1px solid rgba(244, 63, 94, 0.15);
  position: relative;
}
.result-header.danger::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--red);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.6);
}

.result-badge {
  font-size: .74rem; font-weight: 800;
  padding: 6px 16px; border-radius: 20px;
  letter-spacing: .8px; text-transform: uppercase;
  white-space: nowrap; flex-shrink: 0;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger  { background: rgba(244, 63, 94, 0.15); color: var(--red); border: 1px solid rgba(244, 63, 94, 0.3); }

.result-body { padding: 24px 28px; }

/* ============ CHECK ITEMS ============ */
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .88rem;
}

.check-item:last-child { border-bottom: none; }

.check-icon-ok      { color: var(--green); font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.check-icon-fail    { color: var(--red);   font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.check-icon-warn    { color: var(--gold);  font-size: 1.15rem; 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: .8rem; margin-top: 3px; line-height: 1.4; }

/* ============ METRICS GRID ============ */
.metrics-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px; padding: 18px; text-align: center;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.01);
  transition: all 0.3s ease;
}

.metric-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: scale(1.03);
}

.metric-value { font-size: 1.9rem; font-weight: 900; line-height: 1; margin-bottom: 6px; letter-spacing: -0.5px; }
.metric-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; }

/* ============ PROGRESS BAR ============ */
.progress-bar-custom {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px; height: 8px; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-fill {
  height: 100%; border-radius: 10px;
  transition: width .9s cubic-bezier(.4,0,.2,1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
  background-size: 15px 15px;
  opacity: 0.2;
}

.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: 14px; margin: 18px 0;
}

.odd-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px; padding: 14px; text-align: center;
  transition: all 0.3s;
}

.odd-box:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.odd-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 6px; }
.odd-value { font-size: 1.6rem; font-weight: 900; color: var(--gold-light); }
.odd-implied { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* ============ GAUGE ============ */
.margin-gauge {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px; padding: 20px; margin: 18px 0;
}

.gauge-bar-wrapper {
  position: relative; height: 16px;
  background: linear-gradient(90deg,
    var(--green) 0%, var(--green) 30%,
    var(--gold) 30%, var(--gold) 60%,
    var(--red) 60%, var(--red) 100%);
  border-radius: 10px; overflow: visible;
  margin: 14px 0;
}

.gauge-indicator {
  position: absolute; top: -6px;
  width: 5px; height: 28px;
  background: white; border-radius: 3px;
  box-shadow: 0 0 10px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,0.6);
  transition: left .9s cubic-bezier(.4,0,.2,1);
  transform: translateX(-50%);
}

/* ============ ALERT BOXES ============ */
.alert-box {
  border-radius: 14px; padding: 14px 18px; margin: 18px 0;
  display: flex; align-items: flex-start; gap: 12px; font-size: .88rem;
  line-height: 1.5;
}

.alert-box.info { background: rgba(59, 130, 246, 0.06); border: 1px solid rgba(59, 130, 246, 0.15); color: #93c5fd; }
.alert-box.tip  { background: rgba(139, 92, 246, 0.06); border: 1px solid rgba(139, 92, 246, 0.15); color: #c4b5fd; }
.alert-box.warn { background: rgba(245, 158, 11, 0.06); border: 1px solid rgba(245, 158, 11, 0.15); color: #fde68a; }
.alert-box.bad  { background: rgba(244, 63, 94, 0.06);  border: 1px solid rgba(244, 63, 94, 0.15);  color: #fca5a5; }

.alert-box i { flex-shrink: 0; margin-top: 2px; font-size: 1.05rem; }

/* ============ 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(8, 8, 17, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px; padding: 16px; margin-top: 18px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.formula-box::before {
  content: 'MATHEMATICAL ENGINE v1.2';
  position: absolute;
  top: 6px; right: 12px;
  font-size: 0.55rem;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: 1px;
}

.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: .82rem; 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(139,92,246,.3);
  background: var(--bg-card-hover);
  transform: translateX(3px);
}

/* ============ SECTION PANELS ============ */
.section-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px; padding: 20px; margin-bottom: 16px;
}

/* ============ VERDICT BOX ============ */
.verdict-box {
  border-radius: 18px; padding: 24px;
  text-align: center; margin-top: 20px; margin-bottom: 4px;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.verdict-box.vb-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.05);
}
.verdict-box.vb-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.05);
}
.verdict-box.vb-danger {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(244, 63, 94, 0.02));
  border: 1px solid rgba(244, 63, 94, 0.2);
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.05);
}

.verdict-number { font-size: 4.2rem; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.verdict-label  { font-size: 1.05rem; font-weight: 800; margin: 10px 0 6px; letter-spacing: 0.5px; }
.verdict-sub    { font-size: .84rem; }

/* ============ RESPONSIVE ============ */

/* --- Tablet / Sidebar oculto --- */
@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; }
  .tab-content { padding: 20px; }
}

/* Premium Match Card */
.premium-match-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.premium-match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border-color: rgba(59, 130, 246, 0.3);
}
.premium-match-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  opacity: 0; transition: opacity 0.3s;
}
.premium-match-card:hover::before { opacity: 1; }
.match-team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.team-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.team-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.team-name { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-score { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 800; color: var(--text-primary); flex-shrink: 0; }
.match-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 8px; margin-bottom: 2px;
}
.btn-premium-analyze {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(124, 58, 237, 0.3); color: var(--text-primary);
  border-radius: 8px; padding: 8px; font-weight: 600; font-size: 0.85rem; width: 100%;
  cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-premium-analyze:hover {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-color: transparent; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-smart-filter {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-smart-filter:hover, .btn-smart-filter.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--text-primary);
}

/* --- Móvil grande (≤ 700px) --- */
@media (max-width: 700px) {
  /* Layouts */
  .row-grid         { grid-template-columns: 1fr; gap: 14px; }
  .three-col-grid   { grid-template-columns: 1fr 1fr; gap: 10px; }
  .market-grid-3    { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metrics-grid     { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .odds-display     { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

  /* Espaciado general */
  .tab-content      { padding: 14px 12px; }
  .result-body      { padding: 14px 14px; }
  .form-card        { padding: 16px 14px; }

  /* Tipografía */
  .model-title      { font-size: 1.1rem; }
  .model-desc       { font-size: .82rem; }
  .metric-value     { font-size: 1.4rem; }
  .verdict-number   { font-size: 3rem; }
  .big-percent      { font-size: 2.8rem; }

  /* Header */
  .app-header       { padding: 10px 14px; gap: 10px; }
  .header-title     { font-size: .9rem; }

  /* Model header */
  .model-header     { gap: 12px; margin-bottom: 18px; }
  .model-icon       { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 11px; }

  /* Botón analizar */
  .btn-analyze      { padding: 12px 24px; font-size: .88rem; width: 100%; justify-content: center; }

  /* Result card */
  .result-card      { border-radius: 14px; margin-top: 18px; }
  .result-header    { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .result-badge     { font-size: .65rem; padding: 4px 10px; }

  /* Odds */
  .odd-value        { font-size: 1.25rem; }
  .odd-label        { font-size: .6rem; }

  /* Gauge */
  .margin-gauge     { padding: 14px; }

  /* Viability legend */
  .viability-legend { gap: 10px; padding: 10px 12px; }
  .vl-item          { font-size: .76rem; }

  /* Historial */
  .history-item     { padding: 12px 14px; gap: 10px; }
  .db-badge         { display: none; }

  /* Verdict */
  .verdict-box      { padding: 16px; }
  .verdict-label    { font-size: .9rem; }

  /* Section panel */
  .section-panel    { padding: 14px; }

  /* Formula */
  .formula-code     { font-size: .74rem; }

  /* Info box */
  .info-box         { font-size: .8rem; padding: 10px 12px; }

  /* Toast */
  .db-toast         { bottom: 14px; right: 14px; left: 14px; justify-content: center; }
}

/* --- Móvil pequeño (≤ 480px) --- */
@media (max-width: 480px) {
  /* Layouts */
  .three-col-grid   { grid-template-columns: 1fr; }
  .market-grid-3    { grid-template-columns: 1fr; gap: 8px; }
  .market-grid-2    { grid-template-columns: 1fr; gap: 8px; }
  .metrics-grid     { grid-template-columns: 1fr 1fr; gap: 8px; }
  .odds-display     { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

  /* Espaciado */
  .tab-content      { padding: 12px 10px; }
  .form-card        { padding: 14px 12px; }
  .result-body      { padding: 12px; }

  /* Header */
  .header-badge span { display: none; }
  .header-title     { font-size: .84rem; }
  .app-header       { padding: 9px 12px; }

  /* Tipografía */
  .model-title      { font-size: 1rem; }
  .metric-value     { font-size: 1.25rem; }
  .metric-label     { font-size: .6rem; }
  .verdict-number   { font-size: 2.5rem; }
  .big-percent      { font-size: 2.4rem; }
  .check-item       { font-size: .82rem; gap: 8px; }
  .check-label      { font-size: .82rem; }
  .check-value      { font-size: .74rem; }

  /* Model header */
  .model-icon       { width: 40px; height: 40px; font-size: 1rem; }
  .model-header     { gap: 10px; margin-bottom: 14px; }

  /* Inputs */
  .input-field      { padding: 9px 12px; font-size: .86rem; }
  .input-large      { padding: 11px 12px; font-size: .95rem; }
  .input-group-custom label { font-size: .72rem; }

  /* Botón */
  .btn-analyze      { padding: 11px 20px; font-size: .84rem; }
  .btn-clear        { padding: 7px 12px; font-size: .76rem; }
  .btn-import      { padding: 6px 10px; font-size: .8rem; box-shadow: 0 3px 10px rgba(139, 92, 246, .3); }

  /* Result */
  .result-card      { border-radius: 12px; }
  .result-header    { padding: 12px 14px; }
  .odd-value        { font-size: 1.1rem; }
  .odd-box          { padding: 9px 6px; }

  /* Historial */
  .history-item     { padding: 10px 12px; gap: 8px; }

  /* Modal */
  .history-modal-box      { border-radius: 12px; max-height: 96vh; }
  .history-modal-header   { padding: 14px 14px 10px; }
  .history-modal-body     { padding: 12px 14px; }
  .history-modal-title    { font-size: .95rem; }

  /* Verdict */
  .verdict-box      { padding: 14px 12px; }

  /* Formula */
  .formula-box      { padding: 12px; }
  .formula-code     { font-size: .7rem; line-height: 1.7; }

  /* Section panel */
  .section-panel    { padding: 12px; }

  /* Empty state */
  .empty-state      { padding: 50px 16px; }
  .empty-state i    { font-size: 2.8rem; }
  .empty-state p    { font-size: 1rem; }
}

/* --- Móvil muy pequeño (≤ 360px) --- */
@media (max-width: 360px) {
  .metrics-grid     { grid-template-columns: 1fr; }
  .odds-display     { grid-template-columns: 1fr 1fr; }
  .tab-content      { padding: 10px 8px; }
  .model-title      { font-size: .95rem; }
  .verdict-number   { font-size: 2.2rem; }
  .result-header    { flex-direction: column; align-items: flex-start; }
  .result-badge     { align-self: flex-start; }
  .btn-analyze      { font-size: .8rem; padding: 10px 16px; }
  .three-col-grid   { grid-template-columns: 1fr; }
}

/* ============ DB TOAST ============ */
.db-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #047857, #10b981);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(16,185,129,.35);
  z-index: 2000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.db-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============ DB BADGE ============ */
.db-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--green);
}

/* ============ HISTORY LOADING ============ */
.history-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: .88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.spin { animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ DELETE BUTTON ============ */
.btn-delete-history {
  background: transparent;
  border: 1px solid rgba(239,68,68,.3);
  color: rgba(239,68,68,.6);
  border-radius: 6px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .72rem;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-delete-history:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ============ HISTORY CLICKABLE ============ */
.history-item-clickable {
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .15s;
}
.history-item-clickable:hover {
  background: var(--bg-card-hover);
  border-color: var(--purple);
  transform: translateX(3px);
}

/* ============ HISTORY MODAL ============ */
.history-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.history-modal-overlay.active {
  display: flex;
}
.history-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: modalIn .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn {
  from { opacity:0; transform: scale(.93) translateY(12px); }
  to   { opacity:1; transform: scale(1)  translateY(0); }
}
.history-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}
.history-modal-sub {
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.history-modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.history-modal-close:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.history-modal-body {
  overflow-y: auto;
  padding: 20px 22px;
  flex: 1;
}
.history-modal-body::-webkit-scrollbar { width: 5px; }
.history-modal-body::-webkit-scrollbar-track { background: transparent; }
.history-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.history-modal-body .result-card { margin: 0; }

@media (max-width: 600px) {
  .history-modal-box { max-height: 94vh; border-radius: 14px; }
  .history-modal-header { padding: 16px 16px 12px; }
  .history-modal-body { padding: 14px 16px; }
}

/* ============ ANÁLISIS GLOBAL — ESTILOS ============ */
.global-summary-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.global-summary-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.global-summary-item.success { border-color: var(--green); background: rgba(16,185,129,0.08); }
.global-summary-item.warning { border-color: var(--gold); background: rgba(245,158,11,0.08); }
.global-summary-item.danger { border-color: var(--red); background: rgba(239,68,68,0.08); }
.global-summary-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
}
.global-summary-item.success .global-summary-num { color: var(--green); }
.global-summary-item.warning .global-summary-num { color: var(--gold); }
.global-summary-item.danger .global-summary-num { color: var(--red); }
.global-summary-label {
  display: block;
  font-size: .65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.global-model-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: transform .2s, box-shadow .2s;
}
.global-model-card:hover {
  transform: translateX(4px);
  box-shadow: -3px 0 0 var(--purple-light);
}
.global-model-card.success { border-left: 3px solid var(--green); }
.global-model-card.warning { border-left: 3px solid var(--gold); }
.global-model-card.danger { border-left: 3px solid var(--red); }

.global-model-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.global-model-info {
  flex: 1;
  min-width: 0;
}
.global-model-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.global-model-value {
  font-size: .75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.global-model-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .global-summary-bar { flex-direction: column; gap: 8px; }
  .global-model-card { flex-wrap: wrap; }
  .global-model-badge { width: 100%; text-align: center; margin-top: 8px; }
}

/* ============ ANALYSIS LOADER ============ */
.analysis-loader-card {
  background: rgba(14, 14, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 45px 30px;
  text-align: center;
  max-width: 900px;
  margin: 24px auto 0;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: loaderFadeIn 0.3s ease-out forwards;
}

@keyframes loaderFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.loader-spinner-wrapper {
  position: relative;
  width: 74px;
  height: 74px;
  margin-bottom: 24px;
}

.premium-spinner {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.04);
  border-top-color: var(--purple-light);
  border-right-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.5, 0.2, 0.5, 0.8) infinite;
}

.spinner-center-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.7rem;
  color: var(--purple-light);
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
  animation: iconPulse 1.2s ease-in-out infinite alternate;
}

@keyframes iconPulse {
  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0.75; }
  to { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.loader-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.loader-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 340px;
  line-height: 1.4;
}

.loader-progress-track {
  width: 190px;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 10px;
  animation: loadBar 0.9s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

@keyframes loadBar {
  0% { width: 0%; }
  100% { width: 100%; }
}


@media (max-width: 500px) {
  .tab-content { padding: 10px; }
  .history-item { align-items: flex-start; position: relative; padding-bottom: 24px !important; }
  .history-item-actions { position: absolute; bottom: 12px; right: 14px; flex-direction: row !important; align-items: center !important; gap: 10px !important; }
  .btn-delete-history { margin-left: auto; }
}

/* ============ BOTTOM NAVIGATION BAR (APP-LIKE UX) ============ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 20, 30, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: none;
  z-index: 999;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 0 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.80rem;
  font-weight: 600;
  transition: all 0.2s;
}

.bottom-nav-item i {
  font-size: 1.65rem;
  margin-bottom: 4px;
  transition: transform 0.2s;
}

.bottom-nav-item:hover, .bottom-nav-item:active {
  color: var(--text-primary);
}

.bottom-nav-item:active i {
  transform: scale(0.9);
}

.bottom-nav-item.active {
  color: var(--purple-light);
}

.bottom-nav-item.active i {
  color: var(--purple-light);
  transform: translateY(-2px);
  text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* MOBILE RESPONSIVE TWEAKS */
@media (max-width: 767px) {
  .sidebar { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .d-lg-none-custom { display: flex !important; }
  .d-lg-block-custom { display: none !important; }
  .bottom-nav { display: flex; }
  .main-content {
    margin-left: 0 !important;
    padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  }
}


/* =========================================
   COMPACT MOBILE OPTIMIZATIONS (REQUESTED)
   ========================================= */
@media (max-width: 600px) {
    /* 1. Filtros más pequeños */
    .btn-smart-filter {
        padding: 4px 8px !important;
        font-size: 0.65rem !important;
        border-radius: 6px !important;
        gap: 4px !important;
        max-height: 26px !important;
    }
    
    /* 2. Tarjetas de partido súper compactas */
    .premium-match-card {
        padding: 10px !important;
        gap: 6px !important;
        border-radius: 10px !important;
    }
    .match-header {
        padding-bottom: 4px !important;
        margin-bottom: 0 !important;
        font-size: 0.65rem !important;
    }
    .team-name {
        font-size: 0.85rem !important;
    }
    .match-score {
        font-size: 0.9rem !important;
    }
    .team-logo {
        width: 20px !important;
        height: 20px !important;
    }
    .btn-premium-analyze {
        padding: 5px !important;
        font-size: 0.75rem !important;
        border-radius: 6px !important;
    }
    
    /* 3. Mega Dashboard / Modal de Análisis más compacto */
    .analysis-modal-container {
        padding: 15px !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    .tab-content {
        padding: 10px !important;
    }
    .form-card, .result-card, .section-panel {
        padding: 12px 10px !important;
        margin-bottom: 10px !important;
    }
    .metric-value {
        font-size: 1.1rem !important;
    }
    .metric-label {
        font-size: 0.65rem !important;
    }
    h5, h4, h3 {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    .history-item {
        padding: 8px 10px !important;
        gap: 8px !important;
        margin-bottom: 6px !important;
    }
    .global-model-card {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    /* Mostrar SIEMPRE la nav bar inferior en movil */
    .bottom-nav {
        display: flex !important;
        z-index: 99999 !important;
    }
    
    /* 2 PARTIDOS POR FILA EN MOVIL */
    #matches_container {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    .premium-match-card {
        padding: 8px !important;
        gap: 4px !important;
    }
    .team-name {
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .match-score {
        font-size: 0.8rem !important;
    }
    .team-logo {
        width: 16px !important;
        height: 16px !important;
    }
    .match-team-row {
        gap: 4px !important;
    }
}
