:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-dark: #0f172a;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: #fef3c7;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Top Controls */
.site-header {
  background: var(--bg-dark);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.78rem;
  color: #94a3b8;
  display: block;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-pill {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px;
}

.control-pill button {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-pill button:hover {
  color: #ffffff;
}

.control-pill button.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.ad-toggle-btn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ad-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.28);
}

/* Ad Slots (Google AdSense / Programmatic Ready) */
.ad-slot {
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  position: relative;
  transition: all 0.2s ease;
}

body.hide-ads .ad-slot {
  display: none !important;
}

.ad-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-weight: 700;
}

.ad-slot-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ad-slot-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}

.ad-leaderboard {
  min-height: 96px;
  margin: 18px 0;
}

.ad-native-result {
  min-height: 110px;
  margin-top: 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fcd34d;
}

.ad-sidebar-sticky {
  min-height: 280px;
  margin-top: 18px;
}

/* Hero Section */
.hero {
  padding: 18px 0 12px;
}

.hero-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-md);
}

.hero-content h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-content p {
  color: #cbd5e1;
  font-size: 0.95rem;
  max-width: 700px;
}

.hero-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-chip strong {
  display: block;
  font-size: 1.15rem;
  color: var(--accent);
}

.stat-chip span {
  font-size: 0.74rem;
  color: #cbd5e1;
}

/* 7 Calculator Navigation Tabs */
.calc-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}

.calc-tab {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.calc-tab:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.calc-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}

.tab-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.tab-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.2;
}

.tab-info span {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* Main Workspace Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Form Elements */
.form-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  font-weight: 700;
  margin: 18px 0 12px;
}

.form-section-title:first-of-type {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unit-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 7px;
  border-radius: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.range-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  margin-top: 4px;
}

/* Results Panel */
.results-card {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.primary-result-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid #bfdbfe;
}

.primary-result-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1e40af;
}

.primary-result-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.2;
  margin: 4px 0;
}

.primary-result-sub {
  font-size: 0.85rem;
  color: #1e40af;
  font-weight: 600;
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.metric-row span {
  color: var(--text-muted);
}

.metric-row strong {
  color: var(--text-main);
  font-weight: 700;
}

.metric-row.highlight-cost {
  background: var(--success-soft);
  border: 1px solid #a7f3d0;
}

.metric-row.highlight-cost span {
  color: #065f46;
  font-weight: 600;
}

.metric-row.highlight-cost strong {
  color: #047857;
  font-size: 1.08rem;
}

/* Breakdown Progress Bar */
.visual-bar-wrap {
  margin: 14px 0 18px;
}

.visual-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.visual-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.visual-bar-fill-main {
  background: var(--primary);
  height: 100%;
  transition: width 0.3s ease;
}

.visual-bar-fill-waste {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s ease;
}

/* Action Buttons */
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Affiliate Partner Box */
.affiliate-box {
  margin-top: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.affiliate-box h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.affiliate-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.affiliate-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.affiliate-link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* Project Shopping List / Estimate Section */
.estimate-section {
  margin-top: 28px;
}

.estimate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.estimate-table th,
.estimate-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.estimate-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  background: var(--bg-subtle);
}

.estimate-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.estimate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.estimate-total-Amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--success);
}

.remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

/* SEO & FAQ Section */
.seo-section {
  margin: 32px 0 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.faq-item h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.faq-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #94a3b8;
  padding: 28px 0;
  font-size: 0.85rem;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.calc-panel {
  display: none;
}

.calc-panel.active {
  display: block;
}

/* Responsive Design */
@media (max-width: 1100px) {
  .calc-tabs {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .seo-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .calc-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    width: 100%;
    justify-content: space-between;
  }
}

/* Print Stylesheet for clean PDF export */
@media print {
  .site-header,
  .ad-slot,
  .calc-tabs,
  .affiliate-box,
  .seo-section,
  .site-footer,
  .preset-bar,
  .btn-primary,
  .btn-secondary {
    display: none !important;
  }
  .workspace-grid {
    grid-template-columns: 1fr 1fr;
  }
  body {
    background: #ffffff;
  }
}
