/* ============================================================
   AI Token Cost Analyzer - Main Stylesheet
   Dark theme, developer-focused, clean data presentation
   ============================================================ */

:root {
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-tertiary: #21262D;
  --bg-card: #1C2128;
  --bg-hover: #252C35;

  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --text-tertiary: #6E7681;
  --text-link: #58A6FF;
  --text-link-hover: #79C0FF;

  --border-primary: #30363D;
  --border-secondary: #21262D;
  --border-highlight: #58A6FF;

  --accent-blue: #58A6FF;
  --accent-green: #3FB950;
  --accent-orange: #D29922;
  --accent-red: #F85149;
  --accent-purple: #A371F7;
  --accent-teal: #39D353;

  --gradient-hero: linear-gradient(135deg, #1C2128 0%, #0D1117 50%, #161B22 100%);
  --gradient-pro: linear-gradient(135deg, #A371F7 0%, #58A6FF 100%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==============================
   Navigation
   ============================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-pro);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-links a.active {
  color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.1);
}

.nav-pro-btn {
  background: var(--gradient-pro);
  color: #fff !important;
  padding: 6px 18px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
}

.nav-pro-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Language Switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding: 2px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
}

.lang-switch-btn {
  padding: 4px 10px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-switch-btn:hover {
  color: var(--text-primary);
}

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

/* Navigation auth actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-auth-btn {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-auth-btn:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
}

.nav-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
}

.nav-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-pro-badge {
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 10px;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.nav-user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nav-user-menu:hover .nav-user-dropdown {
  display: block;
}

.nav-user-dropdown a {
  display: block;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.1s;
}

.nav-user-dropdown a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ============================================================
   Historical Price Trends (Pro Feature)
   ============================================================ */
.section-trends {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

.trends-controls {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trends-model-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trends-chip {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.trends-chip:hover {
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.trends-chip.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
}

.trends-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

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

.trends-chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.trends-chart-container h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.trends-chart-container canvas {
  width: 100% !important;
  height: 320px !important;
}

.trends-insight {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.trends-insight-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.trends-insight strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.trends-insight p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==============================
   Hero Section
   ============================== */

.hero {
  padding: 80px 24px 60px;
  text-align: center;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border-primary);
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 20px;
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  max-width: 720px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #E6EDF3 0%, #58A6FF 50%, #A371F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent-blue);
  color: #0D1117;
}

.btn-primary:hover {
  background: #79C0FF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn-pro {
  background: var(--gradient-pro);
  color: #fff;
}

.btn-pro:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(163, 113, 247, 0.3);
}

/* ==============================
   Stats Bar
   ============================== */

.stats-bar {
  max-width: 1280px;
  margin: -30px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
  z-index: 2;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==============================
   Section Layout
   ============================== */

.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
}

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ==============================
   Price Comparison Table
   ============================== */

.table-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 140px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.sort-toggle {
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.sort-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.sort-toggle.active {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.08);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-tertiary);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-primary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th:hover {
  color: var(--text-primary);
}

th .sort-indicator {
  margin-left: 4px;
  font-size: 0.7rem;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-secondary);
  vertical-align: middle;
}

tr:hover td {
  background: var(--bg-hover);
}

.model-provider-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
}

.price-cell {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.price-low {
  color: var(--accent-green);
}

.price-mid {
  color: var(--accent-orange);
}

.price-high {
  color: var(--accent-red);
}

.category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.category-flagship { background: rgba(63, 185, 80, 0.12); color: var(--accent-green); }
.category-small { background: rgba(210, 153, 34, 0.12); color: var(--accent-orange); }
.category-reasoning { background: rgba(163, 113, 247, 0.12); color: var(--accent-purple); }
.category-turbo { background: rgba(88, 166, 255, 0.12); color: var(--accent-blue); }
.category-legacy { background: rgba(139, 148, 158, 0.12); color: var(--text-tertiary); }

.pro-locked {
  position: relative;
}

.pro-locked::after {
  content: 'PRO';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--gradient-pro);
  color: #fff;
}

/* ==============================
   Calculator Section
   ============================== */

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

.calc-form {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.calc-form h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.use-case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.use-case-chip {
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.use-case-chip:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.use-case-chip.active {
  background: rgba(88, 166, 255, 0.12);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.calc-results {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-results h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-secondary);
}

.result-row:last-child {
  border-bottom: none;
}

.result-model {
  font-weight: 600;
  font-size: 0.9rem;
}

.result-provider {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.result-cost {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent-green);
}

.result-cost-high {
  color: var(--accent-orange);
}

.calc-summary {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: auto;
}

.calc-summary h4 {
  color: var(--accent-green);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.calc-summary p {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.calc-summary small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 4px;
}

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

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Pro upsell in calculator */
.pro-upsell {
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(163, 113, 247, 0.06);
  border: 1px dashed rgba(163, 113, 247, 0.25);
  border-radius: var(--radius-sm);
  text-align: center;
}

.pro-upsell p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ==============================
   Recommendation Engine
   ============================== */

.recommend-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

.recommend-form {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.recommend-results {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recommend-item {
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.15s;
}

.recommend-item:hover {
  border-color: var(--border-primary);
  background: var(--bg-hover);
}

.recommend-item.best {
  border-color: var(--accent-green);
  background: rgba(63, 185, 80, 0.06);
}

.recommend-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.recommend-model {
  font-weight: 600;
  font-size: 1rem;
}

.recommend-cost {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-green);
}

.recommend-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.best-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ==============================
   Bundles Comparison
   ============================== */

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.bundle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.15s;
}

.bundle-card:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.bundle-provider {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.bundle-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.bundle-price {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.bundle-period {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.bundle-models {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ==============================
   Pricing Page
   ============================== */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
}

.pricing-card.pro {
  border-color: var(--accent-purple);
  background: linear-gradient(180deg, rgba(163, 113, 247, 0.06) 0%, var(--bg-card) 100%);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--gradient-pro);
  color: #fff;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pricing-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pricing-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pricing-amount {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-amount .currency {
  font-size: 1.5rem;
  vertical-align: super;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 28px;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  flex-shrink: 0;
}

.pricing-features li.disabled {
  opacity: 0.4;
}

.pricing-features li.disabled::before {
  background: var(--text-tertiary);
}

.pricing-cta {
  display: block;
  width: 100%;
  text-align: center;
}

/* ==============================
   Blog Section
   ============================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.blog-card-tag {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-blue);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.blog-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.blog-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.blog-card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ==============================
   Newsletter Section
   ============================== */

.newsletter {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.newsletter h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.newsletter p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* ==============================
   Footer
   ============================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  padding: 48px 24px 32px;
  margin-top: 80px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 0;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1280px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ==============================
   Modal
   ============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.15s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ==============================
   Responsive
   ============================== */

@media (max-width: 1024px) {
  .calculator-grid,
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links a:not(.nav-pro-btn) {
    display: none;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 480px) {
  .hero {
    padding: 48px 16px 40px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .section {
    padding: 40px 16px;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.75rem;
  }

  th, td {
    padding: 8px 10px;
  }
}

/* ==============================
   Animations
   ============================== */

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

.animate-in {
  animation: fadeInUp 0.4s ease forwards;
}

/* Highlight animation for Pro features */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.pro-highlight {
  background: linear-gradient(90deg, transparent, rgba(163,113,247,0.08), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Tooltip */
.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-tertiary);
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  .nav, .hero, .footer, .pro-upsell, .newsletter { display: none; }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--accent-green);
  color: #0D1117;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
