/* ═══════════════════════════════════════════════════════════════
   Greenova Calculators — Design System & Technical Report Styling
   ═══════════════════════════════════════════════════════════════ */

/* ── HERO & NAV ── */
.calc-hero {
  background: linear-gradient(135deg, #0d2e18 0%, #174a27 50%, #0c3319 100%);
  color: #ffffff;
  padding: 48px 0 36px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--accent, #ffca08);
}
.calc-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(255,202,8,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.calc-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.calc-hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
  line-height: 1.6;
}

/* Category Filter Tabs */
.calc-categories-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.calc-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full, 9999px);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}
.calc-cat-tab:hover, .calc-cat-tab.active {
  background: var(--accent, #ffca08);
  color: #111;
  border-color: var(--accent, #ffca08);
  box-shadow: 0 4px 14px rgba(255, 202, 8, 0.35);
}

/* Search Bar */
.calc-search-box {
  margin: 24px 0 32px;
  position: relative;
  max-width: 540px;
}
.calc-search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: var(--radius-lg, 20px);
  border: 2px solid var(--border, #D1E0D6);
  background: var(--surface, #FFF);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.calc-search-box input:focus {
  border-color: var(--primary, #287a1c);
  box-shadow: 0 0 0 4px rgba(40, 122, 28, 0.15);
}
.calc-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 1.1rem;
}

/* ── CARDS GRID ── */
.calc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
  margin-bottom: 48px;
}
.calc-card {
  background: var(--surface, #FFF);
  border: 1px solid var(--border-light, #E6EFEA);
  border-radius: var(--radius-lg, 20px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.calc-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light, #5cad1d);
}
.calc-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--surface-alt, #F0F4F2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 16px;
  transition: all 0.25s ease;
}
.calc-card:hover .calc-card-icon {
  background: var(--primary, #287a1c);
  color: #fff;
  transform: scale(1.08);
}
.calc-card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary, #287a1c);
  margin-bottom: 6px;
}
.calc-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #111);
  margin-bottom: 8px;

}
.calc-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary, #4A4A4A);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}
.calc-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: var(--surface-alt, #F0F4F2);
  color: var(--primary-dark, #1d5e13);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm, 10px);
  transition: all 0.2s ease;
}
.calc-card:hover .calc-card-btn {
  background: var(--primary, #287a1c);
  color: #fff;
}

/* ── CALCULATOR ACTIVE WORKSPACE ── */
.calc-workspace {
  background: var(--surface, #FFF);
  border: 1px solid var(--border, #D1E0D6);
  border-radius: var(--radius-xl, 28px);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  margin-bottom: 48px;
}
.calc-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--surface-alt, #F0F4F2);
  margin-bottom: 28px;
}
.calc-workspace-title {
  font-size: 1.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-dark, #1d5e13);
}

.calc-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 36px;
}
@media (max-width: 992px) {
  .calc-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Forms & Input Fields */
.calc-form-group {
  margin-bottom: 20px;
}
.calc-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text, #111);
  margin-bottom: 8px;
}
.calc-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2ece6;
  color: #287a1c;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: help;
  position: relative;
}
.calc-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.calc-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border, #D1E0D6);
  border-radius: var(--radius, 14px);
  background: var(--bg, #F9FBF9);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #111);
  transition: all 0.2s ease;
}
.calc-input:focus {
  border-color: var(--primary, #287a1c);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40, 122, 28, 0.15);
}
.calc-unit {
  position: absolute;
  right: 14px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-light, #777);
  background: var(--surface-alt, #F0F4F2);
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}
body[dir="rtl"] .calc-unit {
  right: auto;
  left: 14px;
}
.calc-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border, #D1E0D6);
  border-radius: var(--radius, 14px);
  background: var(--bg, #F9FBF9);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #111);
  cursor: pointer;
}

.calc-btn-group {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.calc-btn-primary {
  flex: 2;
  min-width: 160px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary, #287a1c), var(--primary-dark, #1d5e13));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  border-radius: var(--radius, 14px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-primary);
  transition: all 0.25s ease;
}
.calc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(40, 122, 28, 0.35);
}
.calc-btn-secondary {
  flex: 1;
  min-width: 120px;
  padding: 14px 20px;
  background: var(--surface-alt, #F0F4F2);
  color: var(--text-secondary, #4A4A4A);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius, 14px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.calc-btn-secondary:hover {
  background: #e2ece6;
  color: #111;
}

/* ── RESULTS PANEL ── */
.calc-results-panel {
  background: linear-gradient(180deg, #F4F8F5 0%, #EBF3ED 100%);
  border: 2px solid #D8E6DC;
  border-radius: var(--radius-lg, 20px);
  padding: 24px;
}
.calc-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.calc-results-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark, #1d5e13);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-res-highlight {
  background: #fff;
  border-radius: var(--radius, 14px);
  padding: 20px;
  margin-bottom: 18px;
  border-left: 5px solid var(--primary, #287a1c);
  box-shadow: var(--shadow-sm);
}
body[dir="rtl"] .calc-res-highlight {
  border-left: none;
  border-right: 5px solid var(--primary, #287a1c);
}
.calc-res-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
}
.calc-res-value {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--primary-dark, #1d5e13);
  line-height: 1.2;
  margin: 4px 0;
}
.calc-res-unit {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary, #287a1c);
  margin-left: 6px;
}
.calc-res-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(40, 122, 28, 0.12);
  color: var(--primary-dark, #1d5e13);
  margin-top: 6px;
}

.calc-res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.calc-res-item {
  background: #fff;
  padding: 14px 16px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid #e1ebe3;
}
.calc-res-item-title {
  font-size: 0.8rem;
  color: #666;
  font-weight: 600;
}
.calc-res-item-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111;
  margin-top: 2px;
}

/* Accordion for Formulas & Hypotheses */
.calc-details-box {
  background: #fff;
  border-radius: var(--radius-sm, 10px);
  padding: 16px;
  font-size: 0.88rem;
  border: 1px solid #dbe6dd;
  margin-top: 16px;
}
.calc-details-box h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-dark, #1d5e13);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.calc-details-box ul {
  padding-left: 18px;
  color: #444;
}
body[dir="rtl"] .calc-details-box ul {
  padding-left: 0;
  padding-right: 18px;
}
.calc-details-box li {
  margin-bottom: 4px;
}

/* Warnings & Disclaimer */
.calc-warning-box {
  background: #fff9e6;
  border: 1.5px solid #ffe082;
  border-radius: var(--radius-sm, 10px);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #856404;
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* ── DYNAMIC SVG SCHEMATIC ── */
.calc-schematic-wrap {
  background: #fff;
  border: 1px solid var(--border-light, #E6EFEA);
  border-radius: var(--radius, 14px);
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}
.calc-schematic-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary-dark, #1d5e13);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── RECOMMENDATIONS & BUNDLE ── */
.calc-recs-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 2px dashed #d1e0d6;
}
.calc-recs-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark, #1d5e13);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.calc-recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.calc-rec-card {
  background: #fff;
  border: 1.5px solid #dce8df;
  border-radius: var(--radius, 14px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}
.calc-rec-card:hover {
  border-color: var(--primary, #287a1c);
  box-shadow: var(--shadow-sm);
}
.calc-rec-role {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary, #287a1c);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.calc-rec-img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  margin: 8px 0;
}
.calc-rec-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
  margin-bottom: 8px;
}
.calc-rec-price {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--primary-dark, #1d5e13);
}

/* Complete Bundle Configuration Box */
.calc-bundle-box {
  background: linear-gradient(135deg, #1b5e20 0%, #0d2e18 100%);
  color: #fff;
  border-radius: var(--radius-lg, 20px);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-lg);
  margin-top: 24px;
}
.calc-bundle-info h3 {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent, #ffca08);
}
.calc-bundle-info p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}
.calc-bundle-price {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
}
.calc-bundle-btn {
  padding: 16px 32px;
  background: var(--accent, #ffca08);
  color: #111;
  font-size: 1.1rem;
  font-weight: 900;
  border-radius: var(--radius, 14px);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 202, 8, 0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.calc-bundle-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 202, 8, 0.6);
  background: #ffd633;
}

/* Action Toolbar (Save, Print, PDF, WhatsApp) */
.calc-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light, #E6EFEA);
}
.calc-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface-alt, #F0F4F2);
  color: var(--text, #111);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  transition: all 0.2s ease;
}
.calc-tool-btn:hover {
  background: var(--primary-light, #5cad1d);
  color: #fff;
}
.calc-tool-btn.btn-wa {
  background: #25D366;
  color: #fff;
}
.calc-tool-btn.btn-wa:hover {
  background: #1eb857;
}

/* ═══════════════════════════════════════════════════════════════
   PRINT REPORT OPTIMIZATION (@media print)
   ═══════════════════════════════════════════════════════════════ */
@media print {
  /* Hide non-report web chrome */
  header, footer, .header, .footer, .calc-hero, .calc-categories-bar, 
  .calc-search-box, .calc-cards-grid, .calc-btn-group, .calc-toolbar,
  .urgency-bar, #top-ad-banner, .crm-widget, button, input[type="button"],
  .lang-toggle, .calc-workspace-header a {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.4;
    margin: 0;
    padding: 0;
  }

  .calc-workspace {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .calc-layout-grid {
    display: block !important;
  }

  /* Printable Report Header */
  .calc-print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #287a1c;
    padding-bottom: 16px;
    margin-bottom: 24px;
  }
  .calc-print-logo {
    height: 60px;
  }
  .calc-print-meta {
    text-align: right;
    font-size: 10pt;
    color: #444;
  }
  body[dir="rtl"] .calc-print-meta {
    text-align: left;
  }

  .calc-res-highlight {
    border: 2px solid #287a1c !important;
    background: #f4f8f5 !important;
    page-break-inside: avoid;
  }

  .calc-recs-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    page-break-inside: avoid;
  }

  .calc-print-footer {
    display: block !important;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid #ccc;
    font-size: 9pt;
    color: #666;
    text-align: center;
    page-break-inside: avoid;
  }
}
