/* ============================================================
   jQuery UI Widgets Comparison — Modern Styles
   ============================================================ */

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

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --no: #dc2626;
  --no-bg: #fee2e2;
  --partial: #d97706;
  --partial-bg: #fef3c7;
  --highlight-row: rgba(59, 130, 246, 0.06);
  --highlight-col: rgba(59, 130, 246, 0.11);
  --table-head-bg: #1e293b;
  --table-head-text: #e2e8f0;
  --section-bg: #0f172a;
  --section-text: #f8fafc;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 24px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(140deg, #0f172a 0%, #1e3a5f 60%, #1d4ed8 100%);
  color: #fff;
  padding: 52px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(96,165,250,.25) 0%, transparent 70%);
  pointer-events: none;
}

.header-inner { position: relative; z-index: 1; }

.header-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(59,130,246,.2);
  border: 1px solid rgba(96,165,250,.4);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 16px;
}

.site-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-header p {
  color: #94a3b8;
  font-size: .9rem;
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.github-btn-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .85;
  transition: opacity .2s;
}
.github-btn-wrapper:hover { opacity: 1; }

/* ── CONTAINER ───────────────────────────────────────────── */
.container {
  max-width: 1640px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

/* ── SECTION LABELS ──────────────────────────────────────── */
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── FAQ SECTION ─────────────────────────────────────────── */
.faq-section { margin-bottom: 36px; }

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.faq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.faq-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.faq-card dt {
  font-weight: 700;
  font-size: .82rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.faq-card dt::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.faq-card dd {
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.65;
}

/* ── SPONSOR BAR ─────────────────────────────────────────── */
.sponsor-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.sponsor-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  transition: all .2s;
  text-decoration: none;
}
.sponsor-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
  text-decoration: none;
}

/* ── TABLE SECTION ───────────────────────────────────────── */
.table-section { }

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── TABLE WRAPPER ───────────────────────────────────────── */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  max-height: 80vh;
  position: relative;
}

/* ── COMPARISON TABLE ────────────────────────────────────── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .78rem;
}

/* Sticky column header (top-left corner) */
.comparison-table thead th:first-child {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 4;
  background: #07101f;
  min-width: 230px;
  width: 230px;
  border-right: 2px solid rgba(255,255,255,.12);
}

/* All other header cells */
.comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--table-head-bg);
  color: var(--table-head-text);
  padding: 13px 12px;
  text-align: center;
  font-weight: 600;
  font-size: .75rem;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.08);
  border-bottom: 2px solid rgba(255,255,255,.15);
  vertical-align: middle;
  line-height: 1.3;
}

.comparison-table thead th a {
  color: #93c5fd;
  text-decoration: none;
  display: inline-block;
  transition: color .15s;
}
.comparison-table thead th a:hover {
  color: #fff;
  text-decoration: none;
}

/* Sticky row header cells */
.comparison-table tbody tr th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 500;
  font-size: .76rem;
  padding: 10px 14px;
  min-width: 230px;
  width: 230px;
  max-width: 280px;
  border-right: 2px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  text-align: left;
  line-height: 1.45;
  vertical-align: middle;
}

/* Regular data cells */
.comparison-table tbody tr td {
  padding: 10px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  min-width: 115px;
  line-height: 1.45;
  background: var(--surface);
  transition: background .1s;
}

.comparison-table tbody tr td a,
.comparison-table tbody tr th a {
  color: var(--primary);
}
.comparison-table tbody tr td a:hover,
.comparison-table tbody tr th a:hover {
  color: var(--primary-dark);
}

.comparison-table tbody tr td small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: .7rem;
  line-height: 1.4;
}

/* Section header rows */
.comparison-table tr.section-header td {
  background: var(--section-bg);
  color: var(--section-text);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Alternating row shading */
.comparison-table tbody tr:nth-child(even) td,
.comparison-table tbody tr:nth-child(even) th[scope="row"] {
  background: #fafbfd;
}
.comparison-table tbody tr:nth-child(even) th[scope="row"] {
  background: #f3f5f9;
}

/* ── HOVER EFFECTS ───────────────────────────────────────── */
.comparison-table tbody tr.row-hover td,
.comparison-table tbody tr.row-hover th[scope="row"] {
  background: var(--highlight-row) !important;
}
.comparison-table td.col-hover {
  background: var(--highlight-col) !important;
}

/* ── ICONS ───────────────────────────────────────────────── */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}

.icon-ok  { background: var(--ok-bg);      color: var(--ok); }
.icon-no  { background: var(--no-bg);       color: var(--no); }
.icon-partial { background: var(--partial-bg); color: var(--partial); }

/* inline icon+text combos */
td .icon { margin-right: 3px; }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: .78rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.site-footer a { color: var(--primary); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-header h1 { font-size: 1.6rem; }
  .faq-grid { grid-template-columns: 1fr; }
  .container { padding: 20px 14px 40px; }
  .table-wrapper { max-height: 70vh; }
  .comparison-table thead th:first-child,
  .comparison-table tbody tr th[scope="row"] {
    min-width: 170px;
    width: 170px;
  }
}
