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

/* Calculator Suite Specific Styles */
.calc-hero h1,
.calc-form-card h2,
.calc-step-title,
.total-range-price,
.results-tag,
.hardware-breakdown-title,
.calc-guide-card h3 {
  font-family: "Raleway", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.02em;
}

button,
input,
select,
.preset-btn,
.pill-option,
.mat-name,
.mat-rate,
.count-btn,
.hardware-list,
.calc-guide-card p,
.load-calc-btn,
.print-btn {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.length-num-input,
.count-val,
.calc-formula,
.equation {
  font-family: "Roboto Mono", monospace;
}

.calc-hero {
  background: linear-gradient(135deg, #090e17 0%, #1e293b 100%);
  color: #ffffff;
  padding: 4rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.calc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.calc-hero-overlay {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.crumb {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.crumb a {
  color: var(--primary-light);
}

.calc-hero h1 {
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.calc-hero p {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 650px;
  margin: 0 auto;
}

.calc-main-section {
  padding: 3.5rem 0 5rem;
}

.calc-layout-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Calculator Form Controls */
.calc-form-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.calc-step-group {
  margin-bottom: 2.2rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border-light);
}

.calc-step-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.calc-step-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.2rem;
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary-50);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* Material Selection Cards */
.material-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.mat-option {
  position: relative;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-page);
}

.mat-option:hover {
  border-color: var(--primary-light);
  background: #ffffff;
}

.mat-option input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  accent-color: var(--primary);
}

.mat-option.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.mat-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.mat-rate {
  font-size: 0.82rem;
  color: var(--primary-dark);
  font-weight: 600;
}

/* Quick Presets for Footage */
.preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.preset-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

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

.length-display-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.length-num-input {
  width: 90px;
  padding: 0.45rem 0.7rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: right;
  outline: none;
}

.length-num-input:focus {
  border-color: var(--border-focus);
}

/* Option Pill Selectors */
.pill-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill-option {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  background: var(--bg-page);
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition);
}

.pill-option:hover {
  border-color: var(--primary-light);
}

.pill-option.active {
  background: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* Gate Counters */
.counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border-light);
}

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

.counter-info span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.counter-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.count-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.count-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.count-val {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
}

/* Custom Checkbox Toggles */
.toggle-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  margin-bottom: 0.8rem;
  cursor: pointer;
}

.toggle-switch-row label {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.toggle-switch-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Right Sticky Results Dashboard */
.calc-results-sticky {
  position: sticky;
  top: 90px;
  background: linear-gradient(145deg, #090e17 0%, #172554 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
}

.results-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.results-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 0.4rem;
}

.total-range-price {
  font-size: clamp(2rem, 3.2vw, 2.7rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.price-per-foot {
  font-size: 0.92rem;
  color: #94a3b8;
}

/* Materials & Hardware Breakdown Grid */
.hardware-breakdown-title {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hardware-list {
  list-style: none;
  margin-bottom: 1.8rem;
}

.hardware-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
  color: #e2e8f0;
}

.hardware-list li strong {
  color: #ffffff;
  font-weight: 700;
}

/* Cost Split Bar */
.split-bar-section {
  margin-bottom: 1.8rem;
}

.split-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.split-bar-track {
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  display: flex;
}

.split-bar-materials {
  background: var(--primary);
  height: 100%;
  width: 52%;
  transition: width 0.35s ease;
}

.split-bar-labor {
  background: var(--secondary-light);
  height: 100%;
  width: 48%;
  transition: width 0.35s ease;
}

.action-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.print-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon-jpg {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: contain;
}

.print-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Print Only Styling */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }
  .site-header,
  .site-footer,
  .calc-hero,
  .ad-wrapper,
  .action-btn-group {
    display: none !important;
  }
  .calc-layout-grid {
    grid-template-columns: 1fr;
  }
  .calc-results-sticky {
    position: static;
    background: none;
    color: #000;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  .total-range-price {
    color: #000;
  }
  .hardware-list li {
    border-bottom: 1px solid #eee;
    color: #333;
  }
  .hardware-list li strong {
    color: #000;
  }
}

@media screen and (max-width: 900px) {
  .calc-layout-grid {
    grid-template-columns: 1fr;
  }
  .calc-results-sticky {
    position: static;
  }
  .calc-form-card {
    padding: 1.5rem;
  }
}

/* Active Material Real-time Info Box */
.active-calc-info {
  margin-top: 1.4rem;
  background: var(--primary-50);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.4rem;
  transition: var(--transition);
}

.active-calc-info h4 {
  font-size: 1.08rem;
  color: var(--primary-dark);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.active-calc-info p {
  font-size: 0.94rem;
  line-height: 1.65;
  color: #065f46;
  margin: 0;
}

/* 12 Dedicated Calculators Grid Section */
.calc-guides-section {
  padding: 4.5rem 0;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.calculator-guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.calc-guide-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.calc-guide-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.calc-guide-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-dark);
  background: var(--primary-100);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.calc-guide-card h3 {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.calc-guide-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.7;
  margin-bottom: 1.4rem;
  flex: 1;
}

.load-calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.load-calc-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

@media screen and (max-width: 600px) {
  .calculator-guides-grid {
    grid-template-columns: 1fr;
  }
}
