/**
 * Discount Calculator - Stylesheet
 * Exact clone matching Calculator.net financial suite
 */

/* ==========================================================================
   Page Layout & Typography
   ========================================================================== */
.discount-page-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 20px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

.discount-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.discount-breadcrumbs {
  font-size: 13px;
  color: #006699;
}

.discount-breadcrumbs a {
  color: #006699;
  text-decoration: none;
}

.discount-breadcrumbs a:hover {
  text-decoration: underline;
}

.discount-breadcrumbs .sep {
  margin: 0 4px;
  color: #666;
}

.discount-breadcrumbs .current {
  color: #006699;
  font-weight: normal;
}

.discount-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.discount-top-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  font-size: 12px;
  color: #334155;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.discount-top-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.discount-page-title {
  font-size: 24px;
  font-weight: bold;
  color: #0844a4;
  margin: 4px 0 12px 0;
}

.discount-instruction-note {
  font-size: 13px;
  color: #333333;
  margin-bottom: 16px;
}

/* Two-column layout */
.discount-layout-grid {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.discount-main-col {
  flex: 1;
  min-width: 0;
}

.discount-sidebar-col {
  width: 290px;
  flex-shrink: 0;
}

/* ==========================================================================
   Calculator Form Box (Exact Clone of Reference Image 2)
   ========================================================================== */
.discount-calc-card {
  background: #f1f1f1;
  border: 1px solid #9bb5cf;
  border-radius: 4px;
  padding: 16px 20px;
  max-width: 440px;
  box-sizing: border-box;
}

.discount-form-table {
  width: 100%;
  border-collapse: collapse;
}

.discount-form-table tr {
  margin-bottom: 8px;
}

.discount-form-table td {
  padding: 5px 4px;
  vertical-align: middle;
  font-size: 13px;
}

.discount-form-table td.label-col {
  width: 160px;
  color: #111827;
  font-weight: normal;
}

.discount-input-affix-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.discount-affix {
  font-size: 13px;
  color: #333333;
  font-weight: bold;
}

.discount-input {
  width: 110px;
  height: 25px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #000000;
}

.discount-input:focus {
  outline: 2px solid #2b5a88;
  border-color: #2b5a88;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #222222;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  accent-color: #1a5276;
  margin: 0;
}

/* Form Action Buttons */
.discount-btn-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn-calculate {
  background-color: #3f8a27;
  color: #ffffff;
  border: 1px solid #2e731b;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-calculate:hover {
  background-color: #357720;
}

.btn-calculate svg {
  fill: #ffffff;
}

.btn-clear {
  background-color: #888888;
  color: #ffffff;
  border: 1px solid #777777;
  padding: 4px 14px;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
}

.btn-clear:hover {
  background-color: #777777;
}

/* ==========================================================================
   Result Box
   ========================================================================== */
.discount-result-box {
  margin-top: 20px;
  border: 1px solid #9bb5cf;
  border-radius: 4px;
  overflow: hidden;
  max-width: 580px;
  background: #ffffff;
}

.discount-result-header {
  background-color: #4a7732;
  color: #ffffff;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
}

.discount-result-save-icon {
  cursor: pointer;
  background: transparent;
  border: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  padding: 2px;
}

.discount-result-save-icon:hover {
  opacity: 0.8;
}

.discount-result-body {
  padding: 16px;
  background-color: #f7fafc;
}

.discount-result-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.highlight-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 12px;
  text-align: center;
}

.highlight-tile .tile-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.highlight-tile .tile-value {
  font-size: 20px;
  font-weight: bold;
}

.tile-saved .tile-value {
  color: #2e7d32;
}

.tile-price .tile-value {
  color: #0844a4;
}

/* Summary Table */
.discount-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.discount-summary-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #edf2f7;
}

.discount-summary-table td:last-child {
  text-align: right;
  font-weight: bold;
}

/* Visualization container */
.discount-visuals-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 14px;
  flex-wrap: wrap;
}

.donut-chart-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.donut-chart-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 22;
}

.donut-chart-price {
  fill: none;
  stroke: #1a5276;
  stroke-width: 22;
  transition: stroke-dasharray 0.4s ease;
}

.donut-chart-saved {
  fill: none;
  stroke: #82c341;
  stroke-width: 22;
  transition: stroke-dasharray 0.4s ease, stroke-dashoffset 0.4s ease;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-price {
  background-color: #1a5276;
}

.swatch-saved {
  background-color: #82c341;
}

/* ==========================================================================
   Fraction Arithmetic Section (Requirement 1 & 5)
   ========================================================================== */
.fraction-solver-card {
  margin-top: 30px;
  border: 1px solid #9bb5cf;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

.fraction-solver-header {
  background: #003366;
  color: #ffffff;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: bold;
}

.fraction-solver-body {
  padding: 16px 20px;
}

.fraction-solver-desc {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 16px;
}

.fraction-inputs-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fraction-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fraction-input {
  width: 60px;
  height: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #7f9db9;
  border-radius: 2px;
}

.fraction-line {
  width: 58px;
  height: 2px;
  background-color: #333333;
}

.fraction-op-select {
  height: 32px;
  padding: 2px 8px;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  background: #ffffff;
}

.fraction-result-display {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.fraction-res-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.fraction-badge {
  font-size: 16px;
  font-weight: bold;
  color: #0844a4;
}

.fraction-track-container {
  margin-top: 14px;
}

.fraction-track-bar {
  height: 20px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}

.fraction-track-saved {
  background: #82c341;
  height: 100%;
}

.fraction-track-price {
  background: #1a5276;
  height: 100%;
}

/* ==========================================================================
   Tiered / Bulk Discount Table
   ========================================================================== */
.tiered-table-card {
  margin-top: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

.tiered-table-header {
  background: #2b5a88;
  color: #ffffff;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: bold;
}

.tiered-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tiered-table th {
  background: #f1f5f9;
  color: #334155;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #cbd5e1;
}

.tiered-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.tiered-table tr:hover {
  background: #f8fafc;
}

/* ==========================================================================
   Educational SEO / AEO / GEO Content
   ========================================================================== */
.discount-geo-section {
  margin-top: 34px;
  line-height: 1.6;
  font-size: 13.5px;
  color: #333333;
}

.discount-geo-section h2 {
  font-size: 18px;
  color: #0844a4;
  margin: 20px 0 10px;
  font-weight: bold;
}

.discount-geo-section h3 {
  font-size: 15px;
  color: #1a5276;
  margin: 16px 0 8px;
  font-weight: bold;
}

.discount-geo-section p {
  margin-bottom: 12px;
}

.formula-box {
  background: #f8fafc;
  border-left: 4px solid #0844a4;
  padding: 10px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: #0f172a;
  margin: 10px 0 14px;
}

/* FAQ Accordion */
.faq-accordion {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-card {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.faq-question-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: #f8fafc;
  border: none;
  font-size: 13.5px;
  font-weight: bold;
  color: #003366;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.faq-question-btn:hover {
  background: #edf2f7;
}

.faq-answer {
  padding: 12px 14px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.55;
  border-top: 1px solid #e2e8f0;
  display: block;
}

/* ==========================================================================
   Sidebar: Search & Financial Calculators Box
   ========================================================================== */
.sidebar-search-box {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  position: relative;
}

.sidebar-search-input {
  flex: 1;
  height: 28px;
  padding: 3px 8px;
  border: 1px solid #7f9db9;
  border-right: none;
  border-radius: 2px 0 0 2px;
  font-size: 13px;
  box-sizing: border-box;
}

.sidebar-search-btn {
  background: #1a5276;
  color: #ffffff;
  border: 1px solid #1a5276;
  border-radius: 0 2px 2px 0;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
}

.sidebar-search-btn:hover {
  background: #003366;
}

.sidebar-autocomplete {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}

.sidebar-autocomplete-item {
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-autocomplete-item:hover {
  background: #f1f5f9;
  color: #0844a4;
}

/* Financial Calculators Box */
.sidebar-calc-box {
  border: 1px solid #9bb5cf;
  border-radius: 3px;
  overflow: hidden;
  background: #ffffff;
}

.sidebar-calc-header {
  background-color: #2b5a88;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 13.5px;
  font-weight: bold;
}

.sidebar-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 10px;
  gap: 4px 10px;
}

.sidebar-calc-grid a {
  font-size: 12px;
  color: #006699;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 0;
}

.sidebar-calc-grid a:hover {
  text-decoration: underline;
}

.sidebar-calc-more {
  padding: 4px 10px 8px;
  border-top: 1px solid #f1f5f9;
}

.sidebar-calc-more a {
  font-size: 12px;
  color: #006699;
  text-decoration: none;
  font-weight: normal;
}

.sidebar-calc-more a:hover {
  text-decoration: underline;
}

.sidebar-category-nav {
  padding: 6px 10px;
  background: #f1f1f1;
  border-top: 1px solid #cbd5e1;
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
}

.sidebar-category-nav a {
  color: #006699;
  text-decoration: none;
  margin: 0 4px;
}

.sidebar-category-nav a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.discount-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}

.discount-modal-box {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.discount-modal-header {
  background: #2b5a88;
  color: #ffffff;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.discount-modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.discount-modal-body {
  padding: 16px 20px;
}

.discount-modal-sub {
  font-size: 13px;
  color: #555555;
  margin-bottom: 14px;
}

.discount-modal-field {
  margin-bottom: 12px;
}

.discount-modal-field label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #222222;
  margin-bottom: 4px;
}

.discount-modal-input {
  width: 100%;
  height: 32px;
  padding: 4px 8px;
  font-size: 14px;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  box-sizing: border-box;
}

.btn-modal-action {
  background: #1a5276;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 10px;
}

.btn-modal-action:hover {
  background: #003366;
}

/* ==========================================================================
   Responsive Rules
   ========================================================================== */
@media (max-width: 820px) {
  .discount-layout-grid {
    flex-direction: column;
  }
  .discount-sidebar-col {
    width: 100%;
  }
  .discount-calc-card {
    max-width: 100%;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  header,
  footer,
  .discount-top-bar,
  .discount-sidebar-col,
  .discount-btn-row,
  .discount-modal-backdrop {
    display: none !important;
  }
  body,
  .discount-page-container {
    padding: 0;
    margin: 0;
    max-width: 100%;
    background: #ffffff !important;
  }
  .discount-calc-card,
  .discount-result-box {
    border: 1px solid #999;
    box-shadow: none;
  }
}
