/* ================================================================
   SLA — Apple-inspired theme (matching vlsm.madworx.ca)
   ================================================================ */

/* ===== CSS Variables — Dark (default) ===== */
:root {
  --bg: #000000;
  --bg-section: #0a0a0a;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --bg-input: rgba(255,255,255,0.06);
  --text-primary: #f5f5f7;
  --text-secondary: rgba(245,245,247,0.7);
  --text-tertiary: rgba(245,245,247,0.45);
  --text-quaternary: rgba(245,245,247,0.25);
  --border: rgba(255,255,255,0.08);
  --border-focus: rgba(221,194,37,0.5);
  --brand: #DDC225;
  --brand-dim: rgba(221,194,37,0.15);
  --brand-glow: rgba(221,194,37,0.08);
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;
  --info: #64d2ff;
  --header-bg: rgba(0,0,0,0.72);
  --table-row-alt: rgba(255,255,255,0.02);
  --table-row-hover: rgba(255,255,255,0.05);
  --code-bg: rgba(255,255,255,0.06);
}

/* ===== Light Mode ===== */
:root.light {
  --bg: #fbfbfd;
  --bg-section: #f5f5f7;
  --bg-card: rgba(0,0,0,0.03);
  --bg-card-hover: rgba(0,0,0,0.06);
  --bg-input: rgba(0,0,0,0.04);
  --text-primary: #1d1d1f;
  --text-secondary: rgba(0,0,0,0.6);
  --text-tertiary: rgba(0,0,0,0.4);
  --text-quaternary: rgba(0,0,0,0.2);
  --border: rgba(0,0,0,0.1);
  --border-focus: rgba(180,155,20,0.5);
  --brand: #b49b14;
  --brand-dim: rgba(180,155,20,0.1);
  --brand-glow: rgba(180,155,20,0.05);
  --header-bg: rgba(251,251,253,0.72);
  --table-row-alt: rgba(0,0,0,0.02);
  --table-row-hover: rgba(0,0,0,0.04);
  --code-bg: rgba(0,0,0,0.04);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color .4s ease, color .4s ease;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-dark { background: var(--bg-section); }

/* ===== Header ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background .4s ease;
}
.nav {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; height: 52px; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text-primary);
}
.brand:hover { text-decoration: none; }
.brand-logo { border-radius: 6px; }
.brand-name { letter-spacing: -0.02em; }
.menu {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.menu a {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  padding: 6px 12px; border-radius: 980px; transition: all .2s ease;
}
.menu a:hover { color: var(--text-primary); background: var(--bg-card); text-decoration: none; }
.theme-btn {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 12px; font-weight: 600; padding: 4px 6px; border-radius: 980px;
  cursor: pointer; transition: all .2s ease; display: flex; align-items: center;
}
.theme-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-sun { display: none; }
:root.light .icon-moon { display: none; }
:root.light .icon-sun { display: block; }
.theme-btn svg { width: 16px; height: 16px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger-line {
  display: block; width: 18px; height: 2px; background: var(--text-secondary);
  margin: 3px 0; transition: all .2s ease; border-radius: 1px;
}

/* ===== Hero ===== */
.hero {
  min-height: 50vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 60px;
  background: radial-gradient(ellipse at 50% 30%, var(--brand-glow), transparent 60%);
}
.hero-content { max-width: 700px; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--brand); background: var(--brand-dim);
  padding: 4px 14px; border-radius: 980px; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 56px); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead {
  font-size: 18px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px;
}
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill {
  font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 980px;
  border: 1px solid var(--border); color: var(--text-tertiary);
}

/* ===== Section headers ===== */
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--brand); margin-bottom: 12px;
}
.section-header h2 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em;
}
.section-desc {
  font-size: 17px; color: var(--text-secondary); margin-top: 12px; max-width: 600px; margin-inline: auto;
}

/* ===== Tool Card ===== */
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; max-width: 100%;
}
@media (min-width: 768px) { .tool-card { padding: 40px; } }

/* ===== Inputs ===== */
.input-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 24px;
}
.input-group {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px;
}
.input-group span {
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.input-group input, .input-group textarea, .input-group select {
  font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 15px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 10px 14px; border-radius: 10px;
  transition: border-color .2s ease, background .2s ease; outline: none;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.input-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
  border-color: var(--border-focus); background: var(--bg-card-hover);
}
.input-actions { display: flex; gap: 8px; align-items: flex-end; padding-top: 20px; }

/* ===== Preset Pills ===== */
.preset-pills {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 24px;
}
.preset-label {
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.pill-preset {
  font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 980px;
  border: 1px solid var(--border); color: var(--text-tertiary);
  cursor: pointer; background: transparent; transition: all .2s ease;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
.pill-preset:hover { border-color: var(--text-tertiary); color: var(--text-primary); }
.pill-preset.active {
  background: var(--brand-dim); border-color: var(--brand); color: var(--brand);
}

/* ===== Buttons ===== */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 600; border: none;
  padding: 10px 20px; border-radius: 980px; cursor: pointer;
  transition: all .2s ease; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary {
  background: var(--brand); color: #000;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-tertiary); color: var(--text-primary); }
.btn-sm { font-size: 12px; padding: 6px 14px; }
.btn-copy { background: var(--bg-input); border: 1px solid var(--border); font-size: 14px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }

/* ===== Info Bar ===== */
.info-bar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  padding: 16px 20px; border-radius: 12px; margin-bottom: 20px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); }
.info-value { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.hidden { display: none !important; }

/* ===== Visual Bar ===== */
.visual-bar {
  height: 32px; border-radius: 8px; overflow: hidden; display: flex;
  margin-top: 16px; border: 1px solid var(--border);
}
.visual-bar .bar-segment {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #000; overflow: hidden;
  white-space: nowrap; transition: all .3s ease; min-width: 2px;
}
.bar-uptime { background: var(--success); }
.bar-downtime { background: var(--danger); }

/* ===== Table ===== */
.table-wrapper { overflow-x: auto; margin-bottom: 16px; border-radius: 12px; border: 1px solid var(--border); }
.calc-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.calc-table th {
  position: sticky; top: 0; z-index: 2;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); background: var(--bg-section); border-bottom: 1px solid var(--border);
  padding: 10px 12px; text-align: left; white-space: nowrap;
}
:root.light .calc-table th { background: #f0f0f2; }
.calc-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  white-space: nowrap; transition: background .15s ease;
}
.calc-table tbody tr:nth-child(even) td { background: var(--table-row-alt); }
.calc-table tbody tr:hover td { background: var(--table-row-hover); }
.calc-table .sla-good { color: var(--success); }
.calc-table .sla-warn { color: var(--warning); }
.calc-table .sla-bad { color: var(--danger); }
.calc-table .sla-label {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px;
}
.downtime-row { cursor: pointer; transition: background .15s ease; }
.downtime-row:hover td { background: var(--table-row-hover) !important; }

/* ===== Planner ===== */
.planner-section { margin-bottom: 0; }
.planner-heading {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
  color: var(--text-primary); letter-spacing: -0.01em;
}
.planner-divider {
  height: 1px; background: var(--border); margin: 32px 0;
}

/* ===== Footer ===== */
.site-footer {
  padding: 32px 0; border-top: 1px solid var(--border);
  background: var(--bg-section);
}
.foot {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.foot p { font-size: 13px; color: var(--text-tertiary); }
.foot-nav { display: flex; gap: 16px; }
.foot-nav a { font-size: 13px; color: var(--text-tertiary); }
.foot-nav a:hover { color: var(--brand); }

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--brand); color: #000; font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 980px; z-index: 9999;
  opacity: 0; transition: all .3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Color helpers ===== */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ===== Mobile ===== */
@media (max-width: 767px) {
  .nav-toggle { display: block; margin-left: auto; }
  .menu {
    display: none; position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    background: var(--bg); flex-direction: column; padding: 24px;
    gap: 4px; z-index: 99; overflow-y: auto;
  }
  body.menu-open .menu { display: flex; }
  body.menu-open .nav-toggle .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(3px, 3px); }
  body.menu-open .nav-toggle .hamburger-line:nth-child(2) { opacity: 0; }
  body.menu-open .nav-toggle .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(3px, -3px); }
  .menu a { font-size: 16px; padding: 12px 16px; border-radius: 12px; }
  .hero { min-height: auto; padding: 100px 20px 40px; }
  .hero h1 { font-size: 28px; }
  .section { padding: 60px 0; }
  .tool-card { padding: 20px; border-radius: 12px; }
  .input-row { flex-direction: column; }
  .input-actions { padding-top: 0; width: 100%; }
  .input-actions .btn { flex: 1; justify-content: center; }
  .info-bar { gap: 10px; }
  .calc-table th, .calc-table td { padding: 6px 8px; font-size: 11px; }
  .preset-pills { gap: 6px; }
  .pill-preset { padding: 4px 10px; font-size: 11px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-quaternary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
