/* ==========================================================================
   College Cost Calculator - Stylesheet
   Exact Clone Matching Reference Images 1 & 2
   Supports 8 Languages, RTL layout for Arabic, and Clean Print Styling
   ========================================================================== */

:root {
  --cc-primary: #003366;
  --cc-link: #0844a4;
  --cc-link-hover: #002277;
  --cc-green-header: #4c7a2d;
  --cc-green-btn: #3e7416;
  --cc-green-btn-hover: #326012;
  --cc-green-highlight: #166534;
  --cc-text-dark: #333333;
  --cc-text-muted: #555555;
  --cc-border-light: #d0d0d0;
  --cc-card-bg: #f6f6f6;
  --cc-input-border: #7f9db9;
  --cc-pie-savings: #2e7d32;
  --cc-pie-other: #2b5a88;
}

.cc-page-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 15px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--cc-text-dark);
}

/* --------------------------------------------------------------------------
   Breadcrumbs & Top Bar
   -------------------------------------------------------------------------- */
.cc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.cc-breadcrumbs {
  color: var(--cc-link);
  font-size: 13px;
}

.cc-breadcrumbs a {
  color: var(--cc-link);
  text-decoration: none;
}

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

.cc-breadcrumbs .sep {
  color: #777777;
  margin: 0 4px;
}

.cc-breadcrumbs .current {
  color: var(--cc-text-dark);
}

.cc-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cc-top-btn {
  background: none;
  border: none;
  color: var(--cc-link);
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 2px;
}

.cc-top-btn:hover {
  color: var(--cc-link-hover);
  background-color: #f1f5f9;
}

/* --------------------------------------------------------------------------
   Page Header
   -------------------------------------------------------------------------- */
.cc-page-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--cc-primary);
  margin: 2px 0 10px 0;
}

.cc-section-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--cc-primary);
  margin: 0 0 6px 0;
}

.cc-section-subtitle {
  font-size: 13px;
  line-height: 1.45;
  color: var(--cc-text-dark);
  margin: 0 0 14px 0;
}

.cc-section-subtitle a {
  color: var(--cc-link);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Two-Column Main Grid (Calculators on Left, Sidebar on Right)
   -------------------------------------------------------------------------- */
.cc-main-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
  margin-bottom: 26px;
}

.cc-content-col {
  min-width: 0;
}

/* Flex Row: Form (Left) & Live Results (Right) */
.cc-calc-flex {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Form Container Card (Exact Replica of Reference Image 1)
   -------------------------------------------------------------------------- */
.cc-form-box {
  background-color: #f6f6f6;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  padding: 10px 14px 14px;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

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

.cc-form-table td {
  padding: 4.5px 3px;
  vertical-align: middle;
}

.cc-form-table td:first-child {
  width: 48%;
  color: var(--cc-text-dark);
  font-size: 13px;
  line-height: 1.3;
}

.cc-form-table td:last-child {
  width: 52%;
}

.cc-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #333;
  flex-wrap: wrap;
}

.cc-input {
  height: 24px;
  padding: 2px 6px;
  border: 1px solid var(--cc-input-border);
  border-radius: 2px;
  font-size: 13px;
  font-family: inherit;
  color: #111827;
  background-color: #ffffff;
  text-align: right;
  width: 90px;
  box-sizing: border-box;
}

.cc-input-medium {
  width: 80px;
}

.cc-select {
  height: 24px;
  padding: 1px 4px;
  border: 1px solid var(--cc-input-border);
  border-radius: 2px;
  font-size: 12.5px;
  font-family: inherit;
  color: #111827;
  background-color: #ffffff;
  max-width: 200px;
}

.cc-unit-prefix {
  font-size: 13px;
  color: #333333;
}

.cc-input-unit {
  font-size: 13px;
  color: #333333;
  white-space: nowrap;
}

.cc-hint-text {
  font-size: 11px;
  color: #555555;
  margin-left: 4px;
  line-height: 1.2;
}

.cc-hint-block {
  display: block;
  font-size: 11px;
  color: #555555;
  margin-top: 2px;
  line-height: 1.2;
}

.cc-btn-row {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.cc-btn-calculate {
  background-color: var(--cc-green-btn);
  color: #ffffff;
  border: 1px solid #2f5911;
  border-radius: 2px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}

.cc-btn-calculate:hover {
  background-color: var(--cc-green-btn-hover);
}

.cc-btn-clear {
  background-color: #e0e0e0;
  color: #333333;
  border: 1px solid #b0b0b0;
  border-radius: 2px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

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

/* --------------------------------------------------------------------------
   Reference Table Box (Exact Replica of Reference Image 1)
   -------------------------------------------------------------------------- */
.cc-ref-section {
  margin-top: 20px;
  font-size: 13px;
}

.cc-ref-title {
  font-weight: bold;
  color: #000000;
  margin-bottom: 4px;
}

.cc-ref-subtitle {
  font-weight: bold;
  color: #333333;
  margin-bottom: 8px;
  line-height: 1.35;
}

.cc-ref-table {
  width: 100%;
  max-width: 480px;
  border-collapse: collapse;
  margin-bottom: 8px;
  border: 1px solid #cccccc;
  background-color: #ffffff;
}

.cc-ref-table td {
  padding: 4px 8px;
  border: 1px solid #e0e0e0;
  font-size: 12.5px;
}

.cc-ref-table td:first-child {
  color: #333333;
  width: 65%;
}

.cc-ref-table td:last-child {
  text-align: right;
  font-weight: 500;
  color: #111111;
  width: 35%;
}

.cc-ref-source {
  font-size: 11.5px;
  color: #555555;
  line-height: 1.4;
}

.cc-ref-source a {
  color: var(--cc-link);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Results Column / Card
   -------------------------------------------------------------------------- */
.cc-results-box {
  background-color: #ffffff;
  border: 1px solid #c8d7e6;
  border-radius: 3px;
  padding: 12px 14px;
  flex: 1;
  min-width: 290px;
  box-sizing: border-box;
}

.cc-results-header {
  font-size: 16px;
  font-weight: bold;
  color: var(--cc-primary);
  border-bottom: 2px solid #2b5a88;
  padding-bottom: 5px;
  margin-bottom: 10px;
}

.cc-hero-highlight {
  background-color: #eaf3e6;
  border: 1px solid #c2e0b6;
  border-radius: 3px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.cc-hero-label {
  font-size: 12px;
  color: #2b5911;
  font-weight: bold;
}

.cc-hero-val {
  font-size: 22px;
  font-weight: bold;
  color: #1b5e20;
  margin-top: 2px;
}

.cc-res-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

.cc-res-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 3px;
  border-bottom: 1px dotted #e2e8f0;
}

.cc-res-metric-label {
  color: #444444;
  font-size: 12.5px;
}

.cc-res-metric-val {
  font-weight: bold;
  color: #111827;
  font-size: 13px;
  text-align: right;
}

.cc-res-metric-highlight {
  color: #0844a4;
  font-weight: bold;
}

.cc-schedule-link {
  display: inline-block;
  font-size: 12.5px;
  color: var(--cc-link);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
}

.cc-schedule-link:hover {
  color: var(--cc-link-hover);
}

/* --------------------------------------------------------------------------
   SVG Charts
   -------------------------------------------------------------------------- */
.cc-chart-card {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  padding: 12px;
  margin-top: 14px;
}

.cc-chart-title {
  font-size: 13.5px;
  font-weight: bold;
  color: var(--cc-primary);
  margin-bottom: 8px;
  text-align: center;
}

.cc-pie-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cc-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

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

.cc-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.cc-bar-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

/* --------------------------------------------------------------------------
   Fraction Arithmetic Solver (Prompt Requirement)
   -------------------------------------------------------------------------- */
.cc-fraction-card {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 14px 16px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.cc-fraction-card h3 {
  font-size: 16px;
  font-weight: bold;
  color: var(--cc-primary);
  margin-bottom: 4px;
}

.cc-fraction-card p {
  font-size: 12.5px;
  color: #475569;
  margin-bottom: 12px;
}

.cc-fraction-solver-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.cc-fraction-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cc-fraction-input {
  width: 55px;
  height: 24px;
  text-align: center;
  border: 1px solid var(--cc-input-border);
  border-radius: 2px;
  font-size: 13px;
  padding: 1px 3px;
}

.cc-fraction-bar {
  width: 100%;
  height: 1.5px;
  background-color: #333333;
  margin: 1px 0;
}

.cc-fraction-op {
  height: 26px;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid var(--cc-input-border);
  border-radius: 2px;
  padding: 1px 4px;
  background: #ffffff;
}

.cc-fraction-eq {
  font-size: 18px;
  font-weight: bold;
  color: #333333;
}

.cc-fraction-res {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  padding: 4px 10px;
}

.cc-fraction-res-frac {
  font-size: 14px;
  font-weight: bold;
  color: var(--cc-primary);
}

.cc-fraction-res-dec {
  font-size: 11.5px;
  color: #334155;
  margin-top: 2px;
}

.cc-visual-bar-wrap {
  margin-top: 8px;
}

.cc-visual-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  margin-bottom: 3px;
}

.cc-visual-bar-track {
  width: 100%;
  height: 18px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.cc-visual-bar-fill-savings {
  background-color: #2e7d32;
  height: 100%;
  transition: width 0.3s ease;
}

.cc-visual-bar-fill-other {
  background-color: #2b5a88;
  height: 100%;
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   Sidebar (Exact Match to Reference Image 1)
   -------------------------------------------------------------------------- */
.cc-sidebar {
  width: 260px;
  box-sizing: border-box;
}

/* Sidebar Search Box */
.cc-search-form {
  display: flex;
  margin-bottom: 12px;
  position: relative;
}

.cc-search-input {
  flex: 1;
  height: 28px;
  padding: 4px 8px;
  border: 1px solid #7f9db9;
  border-right: none;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}

.cc-search-btn {
  background-color: #2e5b88;
  color: #ffffff;
  border: 1px solid #2e5b88;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.cc-search-btn:hover {
  background-color: #1e4b78;
}

/* Autocomplete live suggestions */
.cc-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #7f9db9;
  border-top: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.cc-search-item {
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.cc-search-item:hover, .cc-search-item.active {
  background-color: #e8f0fe;
  color: #0844a4;
}

.cc-search-cat {
  font-size: 11px;
  color: #666666;
}

/* Sidebar Financial Calculators Box */
.cc-side-card {
  border: 1px solid #2b5988;
  margin-bottom: 12px;
  background-color: #ffffff;
}

.cc-side-card-header {
  background-color: #2b5988;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 8px;
}

.cc-side-card-grid {
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 12px;
}

.cc-side-card-grid a {
  color: var(--cc-link);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-side-card-grid a:hover {
  text-decoration: underline;
}

.cc-side-more-link {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e0e0e0;
  font-weight: 500;
}

/* Sidebar Category Footer Tabs */
.cc-side-tabs {
  font-size: 11.5px;
  color: #555555;
  padding: 6px 4px;
  line-height: 1.5;
}

.cc-side-tabs a {
  color: var(--cc-link);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   SEO / AEO / GEO Educational Guide Content
   -------------------------------------------------------------------------- */
.cc-seo-section {
  margin-top: 36px;
  border-top: 1px solid #d0d0d0;
  padding-top: 22px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #333333;
}

.cc-seo-section h2 {
  font-size: 20px;
  color: var(--cc-primary);
  margin: 18px 0 8px 0;
  font-weight: bold;
}

.cc-seo-section h3 {
  font-size: 16px;
  color: var(--cc-primary);
  margin: 14px 0 6px 0;
  font-weight: bold;
}

.cc-seo-section p {
  margin-bottom: 12px;
}

.cc-seo-section ul, .cc-seo-section ol {
  margin: 0 0 14px 22px;
}

.cc-seo-section li {
  margin-bottom: 5px;
}

.cc-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.cc-faq-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 14px;
}

.cc-faq-card h4 {
  font-size: 14px;
  font-weight: bold;
  color: var(--cc-primary);
  margin-bottom: 6px;
}

.cc-faq-card p {
  font-size: 13px;
  color: #475569;
  margin-bottom: 0;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Modals (Exact Clone of Image 2 & Utility Modals)
   -------------------------------------------------------------------------- */
.cc-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 15px;
  box-sizing: border-box;
}

.cc-modal-overlay.active {
  display: flex;
}

.cc-modal-box {
  background-color: #ffffff;
  border: 1px solid #7f9db9;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  font-size: 13px;
}

.cc-modal-box-large {
  max-width: 720px;
}

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

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

.cc-modal-body {
  padding: 16px;
}

.cc-modal-form-group {
  margin-bottom: 12px;
}

.cc-modal-form-group label {
  display: block;
  font-size: 13px;
  color: #333333;
  margin-bottom: 4px;
}

.cc-modal-input {
  width: 100%;
  height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--cc-input-border);
  border-radius: 2px;
  font-size: 13px;
  box-sizing: border-box;
}

.cc-modal-result-box {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 10px 12px;
  margin-top: 14px;
}

.cc-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 10px;
}

.cc-schedule-table th, .cc-schedule-table td {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  text-align: right;
}

.cc-schedule-table th {
  background-color: #2b5988;
  color: #ffffff;
  font-weight: bold;
}

.cc-schedule-table th:first-child, .cc-schedule-table td:first-child,
.cc-schedule-table th:nth-child(2), .cc-schedule-table td:nth-child(2) {
  text-align: left;
}

.cc-schedule-table tr:nth-child(even) {
  background-color: #f8fafc;
}

/* --------------------------------------------------------------------------
   Arabic RTL Adjustments
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .cc-top-bar,
[dir="rtl"] .cc-breadcrumbs,
[dir="rtl"] .cc-input,
[dir="rtl"] .cc-res-metric-val,
[dir="rtl"] .cc-ref-table td:last-child {
  text-align: left;
}

[dir="rtl"] .cc-form-table td:first-child {
  text-align: right;
}

[dir="rtl"] .cc-form-table td:last-child {
  text-align: left;
}

[dir="rtl"] .cc-search-input {
  border-right: 1px solid #7f9db9;
  border-left: none;
}

[dir="rtl"] .cc-btn-calculate {
  flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .cc-main-grid {
    grid-template-columns: 1fr;
  }
  
  .cc-calc-flex {
    flex-direction: column;
  }
  
  .cc-results-box {
    width: 100%;
  }

  .cc-faq-grid {
    grid-template-columns: 1fr;
  }
  
  .cc-sidebar {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Print Stylesheet
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .site-header, .cc-sidebar, .cc-top-actions, .cc-btn-row, .cc-modal-overlay {
    display: none !important;
  }
  
  .cc-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .cc-main-grid {
    display: block !important;
  }
  
  .cc-calc-flex {
    display: block !important;
  }
  
  .cc-form-box, .cc-results-box, .cc-chart-card {
    border: 1px solid #999999 !important;
    margin-bottom: 15px !important;
    break-inside: avoid;
  }
}
