/* 
  T20 Oracle — Styles
  Aesthetic: Stripe / Vercel modern startup
  v2: IPL section added with orange/purple branding
*/

:root {
  /* T20 colours */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --secondary: #10B981;

  /* IPL colours */
  --ipl-primary: #D97706;          /* IPL orange */
  --ipl-primary-hover: #B45309;
  --ipl-secondary: #7C3AED;        /* IPL purple */
  --ipl-secondary-light: #EDE9FE;
  --ipl-accent: #F59E0B;           /* gold */
  --ipl-glow: rgba(217, 119, 6, 0.25);

  /* Surface */
  --bg-color: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --error: #EF4444;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 70px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 40px -10px rgba(37, 99, 235, 0.3);
  --shadow-ipl-glow: 0 0 40px -10px var(--ipl-glow);

  /* Misc */
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
p  { color: var(--text-muted); }

/* ── Utilities ── */
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: #cbd5e1; background-color: #f1f5f9; }

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-main); }

.btn-ipl {
  background: linear-gradient(135deg, var(--ipl-primary), var(--ipl-secondary));
  color: white;
  box-shadow: 0 2px 8px var(--ipl-glow);
  font-weight: 600;
}
.btn-ipl:hover {
  background: linear-gradient(135deg, var(--ipl-primary-hover), #6D28D9);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--ipl-glow);
}

.btn:disabled, .btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; }
.badge {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: var(--transition); }
.nav-links a:hover { color: var(--text-main); }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 6rem 1.5rem;
  text-align: center;
  overflow: hidden;
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; z-index: 10; }
.badge-pill {
  display: inline-block;
  background: rgba(37,99,235,0.1);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle { font-size: 1.125rem; max-width: 620px; margin: 1.5rem auto 2.5rem; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.hero-bg-blur {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 600px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, rgba(16,185,129,0.03) 50%, transparent 70%);
  z-index: 0; pointer-events: none;
}

/* Mode pills in hero */
.hero-mode-pills {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.mode-pill--t20 { background: rgba(37,99,235,0.08); color: var(--primary); border-color: rgba(37,99,235,0.2); }
.mode-pill--ipl { background: rgba(217,119,6,0.1); color: var(--ipl-primary); border-color: rgba(217,119,6,0.25); }

/* ── Architecture ── */
.architecture { padding: 5rem 1.5rem; max-width: var(--max-width); margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 4rem; }
.feature-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.feature-card p { font-size: 0.95rem; line-height: 1.6; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  background: var(--bg-color);
  border: 1px solid var(--border);
}

/* Flow diagram */
.flow-diagram-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.flow-grid { display: flex; flex-direction: column; align-items: center; max-width: 700px; margin: 0 auto; }
.flow-step { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; }
.flow-parallel { display: flex; justify-content: center; gap: 2rem; width: 100%; }
.flow-branch { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; }
.flow-box {
  background: var(--bg-color);
  border: 1px solid var(--border);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--text-main);
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}
.agent-box       { background: #f0fdf4; border-color: #bbf7d0; }
.boss-box        { background: #eff6ff; border-color: #bfdbfe; border-width: 2px; }
.feature-highlight { background: #fffbeb; border-color: #fde68a; }
.flow-desc { font-size: 0.85rem; color: var(--text-muted); max-width: 260px; }
.flow-arrow { color: #cbd5e1; font-size: 1.5rem; margin: 1rem 0; font-weight: bold; }
.arrow-merge { letter-spacing: 2.5rem; }

/* ── Predictor Section (replaces old demo-section) ── */
.predictor-section {
  padding: 4rem 1.5rem 5rem;
  background: #f1f5f9;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.predictor-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ─ Tab Switcher ─ */
.mode-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 2rem;
  max-width: 480px;
  box-shadow: var(--shadow-sm);
}
.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.mode-tab.active          { background: var(--surface); box-shadow: var(--shadow-sm); }
.mode-tab--t20.active     { color: var(--primary); border: 1px solid rgba(37,99,235,0.2); background: rgba(37,99,235,0.05); }
.mode-tab--ipl.active     { color: var(--ipl-primary); border: 1px solid rgba(217,119,6,0.3); background: rgba(217,119,6,0.06); }
.mode-tab:not(.active):hover { color: var(--text-main); background: rgba(0,0,0,0.03); }

.tab-badge-ipl {
  background: linear-gradient(135deg, var(--ipl-primary), var(--ipl-secondary));
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 2px;
}

/* ─ Panel layout ─ */
.predictor-panel { animation: fadeIn 0.25s ease-out; }
.panel-inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3.5rem;
  align-items: start;
}
.panel-info h2 { color: var(--text-main); }
.panel-info p  { margin-bottom: 1.5rem; font-size: 1.05rem; }
.panel-info--ipl h2 { color: var(--text-main); }

/* IPL panel info extras */
.ipl-trophy-badge {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, rgba(217,119,6,0.15), rgba(124,58,237,0.15));
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ipl-primary);
  margin-bottom: 1.25rem;
}
.ipl-heading { background: linear-gradient(135deg, var(--ipl-primary), var(--ipl-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.ipl-stat-chips {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  text-align: center;
  min-width: 80px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-chip:hover { border-color: rgba(217,119,6,0.4); transform: translateY(-1px); }
.chip-val   { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ipl-primary); }
.chip-label { display: block; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* Demo bullets */
.demo-bullets { list-style: none; }
.demo-bullets li { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; font-weight: 500; color: var(--text-main); }
.demo-bullets span { color: var(--secondary); }
.ipl-bullets .ipl-check { color: var(--ipl-primary); }

/* ─ Glass panel ─ */
.glass-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.glass-panel--ipl {
  box-shadow: var(--shadow-lg), var(--shadow-ipl-glow);
  border-color: rgba(217,119,6,0.15);
  overflow: hidden;
  position: relative;
}

/* IPL orange accent bar at top of card */
.ipl-panel-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ipl-primary), var(--ipl-secondary), var(--ipl-primary));
  background-size: 200% 100%;
  animation: ipl-shimmer 3s ease infinite;
}
@keyframes ipl-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─ Forms ─ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.5rem; }

select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
select:disabled { background-color: #f8fafc; color: #94a3b8; cursor: not-allowed; }

/* IPL select accent */
.select--ipl:focus { border-color: var(--ipl-primary); box-shadow: 0 0 0 3px rgba(217,119,6,0.12); }

/* ─ Head-to-head strip ─ */
.ipl-h2h-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(217,119,6,0.07), rgba(124,58,237,0.07));
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
  animation: fadeIn 0.3s ease-out;
}
.h2h-label  { font-weight: 700; color: var(--text-muted); }
.h2h-team   { font-weight: 600; color: var(--text-main); font-size: 0.8rem; }
.h2h-wins   { background: var(--ipl-primary); color: #fff; padding: 1px 8px; border-radius: var(--radius-full); font-weight: 700; font-size: 0.85rem; }
.h2h-vs     { color: var(--text-muted); font-size: 0.75rem; }
.h2h-total  { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; }

/* ─ Spinner ─ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.spinner--ipl { border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─ Results ─ */
.result-panel {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--border);
  animation: fadeIn 0.4s ease-out;
}
.result-panel--ipl { border-top-color: rgba(217,119,6,0.25); }

.error-panel {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease-out;
}

.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.result-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--text-muted); margin-bottom: 0.25rem; }
.res-value     { color: var(--primary); font-size: 1.65rem; }
.res-value--ipl { background: linear-gradient(135deg, var(--ipl-primary), var(--ipl-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.res-text      { font-size: 0.95rem; line-height: 1.6; }

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

/* ─ Circular chart ─ */
.confidence-box { width: 60px; height: 60px; }
.circular-chart { display: block; margin: 0 auto; max-width: 100%; }
.circle-bg     { fill: none; stroke: #e2e8f0; stroke-width: 3.8; }
.circle        { fill: none; stroke-width: 2.8; stroke-linecap: round; transition: stroke-dasharray 1s ease-out; }
.percentage    { fill: var(--text-main); font-family: inherit; font-size: 0.6em; font-weight: 700; text-anchor: middle; }
.blue .circle  { stroke: var(--primary); }
.orange .circle { stroke: var(--ipl-primary); }

/* ─ Footer ─ */
footer { padding: 3rem 1.5rem; background: #fff; border-top: 1px solid var(--border); text-align: center; }
.footer-logo { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }

/* ─ Responsive ─ */
@media (max-width: 850px) {
  .panel-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
  .mode-tabs { max-width: 100%; }
  .mode-tab  { font-size: 0.82rem; padding: 0.6rem 0.75rem; }
  .flow-parallel { flex-direction: column; gap: 1rem; }
  .arrow-merge   { display: none; }
  .form-row      { grid-template-columns: 1fr; gap: 0; }
  .nav-links     { display: none; }
  .glass-panel   { padding: 1.5rem; }
  .ipl-stat-chips { gap: 0.5rem; }
}