@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --color-bg: #f8fafc;
  --color-white: #ffffff;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #eff6ff;
  --color-accent-bg: #dbeafe;
  --color-success: #16a34a;
  --color-success-light: #dcfce7;
  --color-row-alt: #f8fafc;
  --color-header-from: #0f172a;
  --color-header-to: #1e293b;
  --color-hero-from: #1e3a5f;
  --color-hero-to: #0f172a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
}

/* ===================== Header ===================== */
.site-header {
  background: linear-gradient(135deg, var(--color-header-from), var(--color-header-to));
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 8px;
  font-size: 18px;
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

/* ===================== Hero ===================== */
.hero {
  background: linear-gradient(135deg, var(--color-hero-from), var(--color-hero-to));
  padding: 56px 0 48px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
}

.hero-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

/* ===================== Headings ===================== */
h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
  color: var(--color-text);
}

h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px;
  letter-spacing: -0.2px;
}

/* ===================== Breadcrumb ===================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  padding: 12px 0;
}

.breadcrumb a {
  color: var(--color-text-light);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.breadcrumb-sep {
  color: var(--color-text-muted);
  font-size: 12px;
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 600;
}

/* ===================== Category Grid ===================== */
.section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.category-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--color-text);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--color-text);
}

.card-icon-bar {
  background: linear-gradient(135deg, var(--color-header-from), var(--color-header-to));
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #ffffff;
  flex-shrink: 0;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

h1 svg {
  width: 28px;
  height: 28px;
  vertical-align: -4px;
  margin-right: 4px;
}

.card-icon-bar h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.category-card-body {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-card p {
  color: var(--color-text-light);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.category-badges {
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-provider {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

.badge-plans {
  background: var(--color-success-light);
  color: var(--color-success);
}

/* ===================== Filter Bar ===================== */
.filter-bar {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-filter {
  flex: 1;
  min-width: 220px;
}

.filter-item input[type="text"],
.filter-item input[type="number"] {
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--color-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-item input[type="text"]:focus,
.filter-item input[type="number"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.filter-item input[type="text"] {
  width: 100%;
}

.filter-item input[type="number"] {
  width: 90px;
}

.range-inputs {
  display: flex;
  gap: 8px;
}

.filter-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.filter-item input[type="checkbox"] {
  accent-color: var(--color-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-item label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 14px;
}

/* ===================== View Toggle ===================== */
.view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  display: inline-flex;
}

.view-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  color: var(--color-text-light);
  transition: all 0.2s;
  border: none;
}

.view-btn:hover {
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
}

.view-btn.active {
  background: var(--color-accent);
  color: #fff;
}

/* ===================== Comparison Table ===================== */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.comparison-table thead th {
  background: var(--color-header-from);
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: none;
  position: sticky;
  top: 64px;
}

.comparison-table thead th:first-child {
  border-radius: var(--radius) 0 0 0;
}

.comparison-table thead th:last-child {
  border-radius: 0 var(--radius) 0 0;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}

.comparison-table tbody tr:nth-child(even) {
  background: var(--color-row-alt);
}

.comparison-table tbody tr:hover {
  background: var(--color-accent-light);
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.provider-cell {
  font-weight: 600;
}

.provider-cell a {
  color: var(--color-text);
}

.provider-cell a:hover {
  color: var(--color-accent);
}

.val-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
}

.val-yes {
  color: var(--color-success);
  font-weight: 600;
}

.val-no {
  color: var(--color-text-muted);
}

/* ===================== Sort Arrows ===================== */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

th.sortable:hover {
  color: #ffffff;
}

.sort-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.4;
}

th.sortable:not(.sorted) .sort-arrow {
  border-bottom: 5px solid currentColor;
}

th.sorted .sort-arrow {
  opacity: 1;
}

th.sorted-asc .sort-arrow {
  border-bottom: 5px solid #ffffff;
}

th.sorted-desc .sort-arrow {
  border-top: 5px solid #ffffff;
}

/* ===================== Cards Grid ===================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.plan-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.plan-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, var(--color-header-from), var(--color-header-to));
  padding: 18px 20px;
}

.card-provider {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-plan-name {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 4px;
}

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.card-price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.card-price-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.card-features {
  list-style: none;
  flex: 1;
  margin-bottom: 20px;
}

.card-features li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.card-features li:last-child {
  border-bottom: none;
}

.feature-label {
  color: var(--color-text-light);
}

.feature-value {
  font-weight: 600;
  color: var(--color-text);
}

.feature-value.val-yes {
  color: var(--color-success);
}

.feature-value.val-no {
  color: var(--color-text-muted);
}

.card-link {
  display: block;
  text-align: center;
  padding: 12px;
  background: var(--color-accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.card-link:hover {
  background: var(--color-accent-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ===================== Footer ===================== */
.site-footer {
  background: linear-gradient(135deg, var(--color-header-from), var(--color-header-to));
  margin-top: 60px;
  padding: 48px 0 32px;
  color: rgba(255,255,255,0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
  max-width: 320px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul a {
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col ul a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* ===================== Misc ===================== */
.last-sync {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.page-content {
  padding: 32px 0 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 16px;
}

/* ===================== Mobile Nav Toggle ===================== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #ffffff;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-header-from);
    flex-direction: column;
    padding: 8px 16px 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    gap: 2px;
    z-index: 200;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: var(--radius-sm);
  }

  .site-nav a:hover {
    background: rgba(255,255,255,0.08);
  }

  .site-header .container {
    position: relative;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 15px;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stat-value {
    font-size: 20px;
  }

  .hero-stat-label {
    font-size: 12px;
  }

  .filter-row {
    flex-direction: column;
  }

  .search-filter {
    min-width: auto;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .site-header .container {
    height: 56px;
  }

  .site-logo {
    font-size: 16px;
    gap: 8px;
  }

  .site-logo .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .comparison-table thead th {
    top: 56px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .table-wrap {
    margin: 0 -16px 24px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .breadcrumb {
    font-size: 13px;
    margin-bottom: 12px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .page-content {
    padding: 20px 0 0;
  }

  .filter-bar {
    padding: 16px;
  }

  .card-header {
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  .card-price {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero p {
    font-size: 14px;
  }

  .hero-stats {
    gap: 16px;
    flex-wrap: wrap;
  }

  .category-card-body {
    padding: 16px;
  }

  .card-icon-bar {
    padding: 16px;
  }

  .filter-item input[type="number"] {
    width: 100%;
  }

  .range-inputs {
    flex: 1;
  }
}
