/* tools-calc.css — Calculator UI for world-cup-2026.world
   Uses site CSS variables from style-color.css (--clr-accent: #dc2626 red) */

/* ── Variable shim: let wc-module inline styles resolve via site vars ── */
:root {
  --wc-gold:     var(--clr-accent);
  --wc-border:   var(--clr-border);
  --wc-input-bg: var(--clr-bg-alt);
  --wc-text:     var(--clr-text);
  --wc-muted:    var(--clr-text-muted);
  --wc-card:     var(--clr-bg-alt);
  --wc-update:   var(--clr-text-muted);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.tool-breadcrumb {
  background: var(--clr-bg-alt);
  border-bottom: 1px solid var(--clr-border);
  padding: var(--space-3) 0;
  font-size: 13px;
  color: var(--clr-text-muted);
}
.tool-breadcrumb .container {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
}
.tool-breadcrumb a { color: var(--clr-accent); text-decoration: none; }
.tool-breadcrumb a:hover { text-decoration: underline; }
.tool-breadcrumb-sep { color: var(--clr-text-muted); }

/* ── Tool Hero ──────────────────────────────────────────────── */
.tool-hero {
  background: var(--clr-bg-dark);
  padding: var(--space-12) 0 var(--space-10);
  position: relative;
  overflow: hidden;
}
.tool-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 80% at 75% 50%, var(--clr-accent-glow) 0%, transparent 65%);
  pointer-events: none;
}
.tool-hero .container { position: relative; }
.tool-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--clr-accent-faint);
  border: 1px solid var(--clr-accent);
  color: var(--clr-accent-light);
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.tool-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 900;
  color: var(--clr-text-inv);
  margin-bottom: var(--space-3);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.tool-hero h1 strong { color: var(--clr-accent-light); font-style: normal; }
.tool-hero > .container > p {
  font-size: 15px;
  color: var(--clr-text-inv-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* ── Main layout ────────────────────────────────────────────── */
.tool-main {
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
  display: flex; flex-direction: column; gap: var(--space-10);
}

/* ── Calculator box ─────────────────────────────────────────── */
.wc-calc {
  background: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
}
.wc-calc > h2 {
  font-size: 18px; font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--clr-accent);
}

/* ── Form fields ────────────────────────────────────────────── */
.wc-field { margin-bottom: var(--space-4); }
.wc-label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase; letter-spacing: .06em;
}
.wc-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font-body);
  color: var(--clr-text); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield;
}
.wc-input:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-glow);
}
.wc-input::-webkit-outer-spin-button,
.wc-input::-webkit-inner-spin-button { -webkit-appearance: none; }
select.wc-input { appearance: none; cursor: pointer; }

/* ── Parlay legs ────────────────────────────────────────────── */
.leg-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: var(--space-3); align-items: center; margin-bottom: var(--space-3);
}
.leg-num {
  font-size: 11px; font-weight: 800;
  color: var(--clr-accent);
  min-width: 38px; text-align: center;
  background: var(--clr-accent-faint);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xs);
  padding: 3px 6px; white-space: nowrap;
}
.btn-remove {
  width: 30px; height: 30px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); cursor: pointer;
}
.btn-remove:hover { background: #fef2f2; border-color: var(--clr-accent); color: var(--clr-accent); }

/* ── Buttons ────────────────────────────────────────────────── */
.wc-btn-row {
  display: flex; gap: var(--space-3);
  margin-top: var(--space-5); flex-wrap: wrap;
}
.wc-btn-add {
  flex: 1; padding: 10px var(--space-4);
  border: 2px dashed var(--clr-accent);
  border-radius: var(--radius-sm);
  color: var(--clr-accent); font-size: 14px; font-weight: 700;
  background: transparent; transition: all var(--transition);
  cursor: pointer; min-width: 120px; font-family: var(--font-body);
}
.wc-btn-add:hover { background: var(--clr-accent-faint); }
.wc-btn-add:disabled { opacity: .4; cursor: not-allowed; }
.wc-btn-calc {
  flex: 2; padding: 11px var(--space-6);
  background: var(--clr-accent); color: #fff;
  font-size: 15px; font-weight: 800;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer; min-width: 140px;
  font-family: var(--font-body); border: none;
}
.wc-btn-calc:hover { background: var(--clr-accent-dark); }

/* ── Results ────────────────────────────────────────────────── */
.wc-result {
  display: none; margin-top: var(--space-6);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  animation: wc-fadeIn .2s ease;
}
.wc-result.show { display: block; }
@keyframes wc-fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.wc-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px var(--space-4); font-size: 14px;
  border-bottom: 1px solid var(--clr-border); gap: var(--space-4);
}
.wc-result-row:last-child { border-bottom: none; }
.wc-result-row span:last-child { font-weight: 700; }
.wc-result-row.highlight {
  background: var(--clr-accent-faint);
  font-size: 16px; font-weight: 800; color: var(--clr-accent-dark);
}
.wc-result-row.highlight span:last-child { color: var(--clr-accent); }

/* ── Error ──────────────────────────────────────────────────── */
.wc-error {
  display: none; padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fef2f2; color: var(--clr-accent-dark);
  font-size: 13px; margin-top: var(--space-3);
  border: 1px solid var(--clr-border);
}
.wc-error.show { display: block; }

/* ── Description box ────────────────────────────────────────── */
.wc-desc {
  background: var(--clr-bg-alt);
  border-left: 3px solid var(--clr-accent);
  padding: var(--space-5) var(--space-6);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.wc-desc p {
  font-size: 14px; color: var(--clr-text-muted);
  line-height: 1.75; margin-bottom: var(--space-3);
}
.wc-desc p:last-child { margin-bottom: 0; }

/* ── Content sections ───────────────────────────────────────── */
.wc-section h2 {
  font-size: 20px; font-weight: 700;
  margin-bottom: var(--space-5); color: var(--clr-text);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--clr-border);
}
.wc-section h3 {
  font-size: 16px; font-weight: 700;
  margin: var(--space-5) 0 var(--space-3); color: var(--clr-text);
}
.wc-section p {
  color: var(--clr-text-muted); margin-bottom: var(--space-3);
  line-height: 1.75; font-size: 14px;
}
.wc-section ol, .wc-section ul {
  padding-left: var(--space-6); color: var(--clr-text-muted);
  line-height: 1.85; margin-bottom: var(--space-4); font-size: 14px;
}
.wc-section ol li, .wc-section ul li { margin-bottom: var(--space-2); }
.wc-section code {
  font-family: ui-monospace, 'Courier New', monospace; font-size: 13px;
  background: var(--clr-bg-alt); padding: 2px 6px; border-radius: 4px;
  color: var(--clr-accent-dark); border: 1px solid var(--clr-border);
}
.wc-section details {
  border: 1px solid var(--clr-border); border-radius: var(--radius-sm);
  margin-bottom: var(--space-3); overflow: hidden;
}
.wc-section summary {
  padding: var(--space-3) var(--space-4);
  cursor: pointer; font-weight: 600; font-size: 14px;
  color: var(--clr-text); list-style: none; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--clr-bg-alt); transition: background var(--transition);
}
.wc-section summary:hover { background: var(--clr-accent-faint); }
.wc-section summary::-webkit-details-marker { display: none; }
.wc-section summary::after { content: '+'; color: var(--clr-accent); font-size: 20px; font-weight: 300; }
.wc-section details[open] summary { background: var(--clr-accent-faint); }
.wc-section details[open] summary::after { content: '−'; }
.wc-section details > p { padding: var(--space-4); margin: 0; border-top: 1px solid var(--clr-border); }

/* ── Embed ──────────────────────────────────────────────────── */
.wc-embed pre {
  background: var(--clr-bg-dark); color: var(--clr-text-inv-muted);
  padding: var(--space-5); border-radius: var(--radius-sm);
  font-size: 12px; overflow-x: auto; margin: var(--space-3) 0;
  white-space: pre-wrap; word-break: break-all; line-height: 1.6;
}

/* ── Related tools ──────────────────────────────────────────── */
.tool-related h2 { font-size: 18px; font-weight: 700; margin-bottom: var(--space-4); }
.tool-related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3);
}
.tool-related-grid a {
  display: block; padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-alt); border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  color: var(--clr-text); transition: all var(--transition); text-decoration: none;
}
.tool-related-grid a:hover {
  border-color: var(--clr-accent); background: var(--clr-accent-faint); color: var(--clr-accent);
}

/* ── Odds table ─────────────────────────────────────────────── */
.wc-odds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wc-odds-table th {
  background: var(--clr-bg-dark); color: var(--clr-text-inv-muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: var(--space-3) var(--space-4); text-align: left;
}
.wc-odds-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--clr-border); color: var(--clr-text);
}
.wc-odds-table tr:last-child td { border-bottom: none; }
.wc-odds-table tr:hover td { background: var(--clr-accent-faint); }
.wc-update-time { font-size: 12px; color: var(--clr-text-muted); margin-top: var(--space-3); text-align: right; }

/* ── Group sim table ────────────────────────────────────────── */
.sim-match-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sim-match {
  background: var(--clr-bg-alt); border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
}
.sim-team-name { flex: 1; font-size: 13px; font-weight: 700; }
.sim-team-name.home { text-align: right; }
.sim-score-input {
  width: 48px; text-align: center; padding: 6px;
  background: #fff; border: 1px solid var(--clr-border);
  border-radius: var(--radius-xs); color: var(--clr-text);
  font-size: 15px; font-weight: 700; outline: none; font-family: inherit;
  -moz-appearance: textfield;
}
.sim-score-input:focus { border-color: var(--clr-accent); }
.sim-score-input::-webkit-outer-spin-button,
.sim-score-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sim-vs { color: var(--clr-accent); font-weight: 900; font-size: 14px; }
.standings-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.standings-table th {
  background: var(--clr-bg-dark); color: var(--clr-accent);
  font-size: 12px; padding: 8px 10px; text-align: center;
  border-bottom: 1px solid var(--clr-border);
}
.standings-table th:nth-child(2) { text-align: left; }
.standings-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--clr-border); }
.standings-table td:nth-child(2) { text-align: left; font-weight: 700; }
.standings-table tr.advance td { color: var(--clr-accent); font-weight: 700; }

/* ── Standings predictor ────────────────────────────────────── */
.outcome-btns { display: flex; gap: 6px; }
.outcome-btn {
  flex: 1; padding: 7px 4px;
  background: var(--clr-bg-alt); border: 1px solid var(--clr-border);
  border-radius: var(--radius-xs); color: var(--clr-text-muted);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .15s; text-align: center; font-family: inherit;
}
.outcome-btn.sel-H { background: #1b5e20; border-color: #4caf50; color: #fff; }
.outcome-btn.sel-D { background: var(--clr-accent-faint); border-color: var(--clr-accent); color: var(--clr-accent-dark); }
.outcome-btn.sel-A { background: #5c1010; border-color: #f44; color: #fff; }
.match-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--clr-border); font-size: 13px;
}
.match-row:last-child { border-bottom: none; }
.match-home { flex: 1; text-align: right; font-weight: 700; }
.match-away { flex: 1; font-weight: 700; }
.st-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.st-table th {
  background: var(--clr-bg-dark); color: var(--clr-accent);
  font-size: 12px; padding: 6px 8px; text-align: center;
}
.st-table th:nth-child(2) { text-align: left; }
.st-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--clr-border); }
.st-table td:nth-child(2) { text-align: left; font-weight: 700; }
.st-table tr.top2 td { color: var(--clr-accent); font-weight: 700; }

/* ── Hub page ───────────────────────────────────────────────── */
.tools-hub-hero {
  background: var(--clr-bg-dark);
  padding: var(--space-10) 0 var(--space-8);
  position: relative; overflow: hidden;
}
.tools-hub-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 100% at 80% 50%, var(--clr-accent-glow) 0%, transparent 65%);
  pointer-events: none;
}
.tools-hub-hero .container { position: relative; }
.tools-hub-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(26px, 5vw, 42px); font-weight: 900;
  color: var(--clr-text-inv); margin-bottom: var(--space-3);
  text-transform: uppercase; letter-spacing: -0.01em;
}
.tools-hub-hero h1 strong { color: var(--clr-accent-light); }
.tools-hub-hero p { font-size: 15px; color: var(--clr-text-inv-muted); max-width: 520px; line-height: 1.7; }
.tools-hub-section { padding: var(--space-10) 0; }
.tools-hub-section-title {
  font-size: 20px; font-weight: 700; margin-bottom: var(--space-6);
  padding-bottom: var(--space-3); border-bottom: 2px solid var(--clr-accent);
}
.tools-hub-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5);
}
.tool-card {
  border: 1px solid var(--clr-border); border-radius: var(--radius-md);
  overflow: hidden; transition: all var(--transition-slow);
  text-decoration: none; background: var(--clr-bg-alt); display: block;
}
.tool-card:hover { border-color: var(--clr-accent); box-shadow: var(--clr-shadow-md); transform: translateY(-2px); }
.tool-card-head {
  background: var(--clr-bg-dark);
  padding: var(--space-6) var(--space-5);
  display: flex; align-items: center; gap: var(--space-4);
}
.tool-card-icon { font-size: 28px; flex-shrink: 0; }
.tool-card-name {
  font-family: var(--font-heading); font-size: 16px; font-weight: 900;
  color: var(--clr-text-inv); text-transform: uppercase; letter-spacing: .01em;
}
.tool-card-tag {
  font-size: 10px; font-weight: 700; color: var(--clr-accent-light);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 2px;
}
.tool-card-body { padding: var(--space-4) var(--space-5); }
.tool-card-desc { font-size: 13px; color: var(--clr-text-muted); line-height: 1.6; margin-bottom: var(--space-4); }
.tool-card-cta { font-size: 13px; font-weight: 700; color: var(--clr-accent); }
.tool-card:hover .tool-card-cta { text-decoration: underline; }

/* ── Powered by bar ─────────────────────────────────────────── */
.tool-powered-bar {
  text-align: center; padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-alt); border-top: 1px solid var(--clr-border);
  font-size: 12px; color: var(--clr-text-muted);
}
.tool-powered-bar a { color: var(--clr-accent); font-weight: 600; text-decoration: none; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .wc-calc { padding: var(--space-5); }
  .wc-btn-row { flex-direction: column; }
  .wc-btn-add, .wc-btn-calc { flex: none; width: 100%; }
  .tool-related-grid { grid-template-columns: 1fr 1fr; }
  .tools-hub-grid { grid-template-columns: 1fr; }
}
