/* ==========================================================================
   Currency Calculator Stylesheet - Calculator Archive
   Pixel-perfect replica of reference Image 2 + Full Multilingual Support,
   Fraction Arithmetic Solver, Visual Charts, History Storage & Clean Print Engine
   ========================================================================== */

:root {
  --cur-blue-header: #2b5a88;
  --cur-blue-dark: #1b4570;
  --cur-blue-link: #0844a4;
  --cur-blue-hover: #002277;
  --cur-box-bg: #f4f4f4;
  --cur-border: #cccccc;
  --cur-border-blue: #a3b8cc;
  --cur-input-border: #7f9db9;
  --cur-green-btn: #2e7d32;
  --cur-green-hover: #1e5c22;
  --cur-gray-btn: #e0e0e0;
  --cur-gray-btn-hover: #d0d0d0;
  --cur-font: Arial, Helvetica, sans-serif;
  --cur-mono: Consolas, "Courier New", Courier, monospace;
}

/* Base Page Layout */
.cur-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 16px 48px;
  font-family: var(--cur-font);
  color: #333333;
}

/* Top Utility & Breadcrumb Bar */
.cur-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.cur-breadcrumbs {
  font-size: 13px;
  color: #555555;
}

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

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

.cur-breadcrumbs .sep {
  margin: 0 4px;
  color: #666666;
}

.cur-breadcrumbs .current {
  color: #333333;
  font-weight: normal;
}

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

.cur-saved-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.cur-saved-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.cur-print-link {
  color: var(--cur-blue-link);
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 6px;
}

.cur-print-link:hover {
  color: var(--cur-blue-hover);
}

/* Page Title (Image 2) */
.cur-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #000000;
  margin: 0 0 10px 0;
  line-height: 1.2;
}

/* Blue Instruction Banner (Exact Image 2) */
.cur-instruction-banner {
  background-color: var(--cur-blue-header);
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  border-radius: 2px;
}

.cur-instruction-banner svg {
  flex-shrink: 0;
}

/* Two-Column Main Layout */
.cur-main-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.cur-content-col {
  flex: 1;
  min-width: 0;
}

.cur-sidebar-col {
  width: 270px;
  flex-shrink: 0;
}

/* Tool Navigation Tabs (Currency Converter + Fraction & Ratio Solver) */
.cur-nav-tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
  border-bottom: 2px solid var(--cur-blue-header);
  gap: 4px;
}

.cur-nav-tab-item {
  margin: 0;
}

.cur-nav-tab-btn {
  background-color: #e8eff6;
  border: 1px solid #b8cde0;
  border-bottom: none;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: bold;
  color: var(--cur-blue-header);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: all 0.15s ease;
}

.cur-nav-tab-btn:hover {
  background-color: #dce7f3;
}

.cur-nav-tab-btn.active {
  background-color: var(--cur-blue-header);
  color: #ffffff;
  border-color: var(--cur-blue-header);
}

/* Calculator Card (Image 2 style) */
.cur-card {
  border: 1px solid var(--cur-border);
  background-color: #ffffff;
  margin-bottom: 20px;
  border-radius: 2px;
  overflow: hidden;
}

.cur-card-header {
  background-color: #eef3f8;
  border-bottom: 1px solid #d4e0eb;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: bold;
  color: #1a365d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cur-card-body {
  padding: 16px 18px;
  background-color: #fafbfc;
}

/* Form Tables */
.cur-form-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.cur-form-table td {
  padding: 6px 4px;
  vertical-align: middle;
}

.cur-form-table td.label-col {
  width: 90px;
  font-size: 13px;
  color: #333333;
  font-weight: normal;
}

.cur-form-table td.input-col {
  width: auto;
}

/* Inputs & Selects */
.cur-input {
  border: 1px solid var(--cur-input-border);
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
  color: #000000;
  background-color: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.cur-input:focus {
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.35);
}

.cur-input-amt {
  width: 180px;
  font-weight: 500;
}

.cur-select {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--cur-input-border);
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
  color: #000000;
  background-color: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.cur-select:focus {
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.35);
}

.cur-checkbox-row {
  margin: 8px 0 12px;
  font-size: 12.5px;
  color: #444444;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cur-checkbox-row input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.cur-checkbox-row label {
  cursor: pointer;
}

/* Buttons */
.cur-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.cur-btn-calc {
  background-color: var(--cur-green-btn);
  color: #ffffff;
  border: 1px solid #1e5c22;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.cur-btn-calc:hover {
  background-color: var(--cur-green-hover);
}

.cur-btn-clear {
  background-color: var(--cur-gray-btn);
  color: #333333;
  border: 1px solid #c0c0c0;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.cur-btn-clear:hover {
  background-color: var(--cur-gray-btn-hover);
}

/* Calculation Results Box */
.cur-result-box {
  margin-top: 14px;
  padding: 12px 16px;
  background-color: #f1f8e9;
  border: 1px solid #c5e1a5;
  border-radius: 3px;
}

.cur-result-main {
  font-size: 19px;
  font-weight: bold;
  color: #1b5e20;
  margin-bottom: 4px;
}

.cur-result-rates {
  font-size: 12.5px;
  color: #33691e;
  line-height: 1.4;
}

.cur-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cur-small-btn {
  background: #ffffff;
  border: 1px solid #aed581;
  color: #2e7d32;
  font-size: 11.5px;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.cur-small-btn:hover {
  background: #f1f8e9;
  border-color: #8bc34a;
}

/* Customized Exchange Rate Box */
.cur-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333333;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cur-custom-input {
  width: 75px;
  text-align: center;
}

/* Market Exchange Rates Section */
.cur-section-title {
  font-size: 17px;
  font-weight: bold;
  color: #1a365d;
  margin: 22px 0 6px 0;
}

.cur-table-timestamp {
  font-size: 12px;
  color: #555555;
  margin-bottom: 12px;
  line-height: 1.4;
}

.cur-subheading {
  font-size: 14px;
  font-weight: bold;
  color: #000000;
  margin: 14px 0 6px 0;
}

/* Tables (Exact Replica of Image 2) */
.cur-table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #b8cde0;
  background: #ffffff;
  margin-bottom: 16px;
}

.cur-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  white-space: nowrap;
}

.cur-table th {
  background-color: #2b5a88;
  color: #ffffff;
  font-weight: bold;
  padding: 6px 8px;
  text-align: right;
  border: 1px solid #1b4570;
}

.cur-table th:first-child {
  text-align: left;
  background-color: #1b4570;
}

.cur-table td {
  padding: 5px 8px;
  border: 1px solid #e0e0e0;
  text-align: right;
  color: #222222;
}

.cur-table td:first-child {
  text-align: left;
  font-weight: bold;
  background-color: #f7f9fa;
  color: #0844a4;
  cursor: pointer;
}

.cur-table td:first-child:hover {
  text-decoration: underline;
  background-color: #eaf1f8;
}

.cur-table tr:nth-child(even) td {
  background-color: #fafbfc;
}

.cur-table tr:hover td {
  background-color: #f0f7ff;
}

.cur-table-note {
  font-size: 11.5px;
  color: #666666;
  font-style: italic;
  margin: 4px 0 16px 0;
}

/* All Currencies Table Base Selection */
.cur-base-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px 0;
  flex-wrap: wrap;
  font-size: 13px;
  color: #333333;
}

.cur-base-tag {
  background-color: #eef3f8;
  border: 1px solid #a3b8cc;
  color: #0844a4;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 2px;
}

.cur-base-tag:hover,
.cur-base-tag.active {
  background-color: #2b5a88;
  color: #ffffff;
  border-color: #1b4570;
}

.cur-search-filter-input {
  margin-left: auto;
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid var(--cur-input-border);
  border-radius: 2px;
  width: 170px;
}

/* Visual Charts & Comparison Panel */
.cur-visual-card {
  border: 1px solid var(--cur-border-blue);
  background-color: #ffffff;
  margin-bottom: 20px;
  border-radius: 2px;
  overflow: hidden;
}

.cur-chart-container {
  padding: 16px;
  background-color: #ffffff;
}

.cur-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.cur-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.cur-bar-label {
  width: 90px;
  font-weight: bold;
  color: #333333;
}

.cur-bar-track {
  flex: 1;
  height: 20px;
  background-color: #edf2f7;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.cur-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2b5a88, #4285f4);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.cur-bar-val {
  width: 80px;
  text-align: right;
  font-weight: bold;
  color: #1a365d;
}

/* Fraction Arithmetic Section (Requirement 1 & 5) */
.frac-form-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.frac-input-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.frac-num,
.frac-den {
  width: 60px;
  height: 32px;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  border: 1px solid var(--cur-input-border);
  border-radius: 3px;
}

.frac-bar {
  width: 60px;
  height: 2px;
  background-color: #000000;
}

.frac-op-select {
  font-size: 18px;
  font-weight: bold;
  padding: 4px 8px;
  border: 1px solid var(--cur-input-border);
  border-radius: 3px;
  background-color: #ffffff;
  cursor: pointer;
}

.frac-equals {
  font-size: 22px;
  font-weight: bold;
  color: #444444;
}

.frac-res-box {
  background-color: #eef7ee;
  border: 1px solid #b7e1b7;
  padding: 14px 18px;
  border-radius: 3px;
  margin-top: 14px;
}

.frac-res-primary {
  font-size: 22px;
  font-weight: bold;
  color: #1e5c22;
  display: flex;
  align-items: center;
  gap: 12px;
}

.frac-steps-list {
  margin: 10px 0 0 18px;
  padding: 0;
  font-size: 12.5px;
  color: #333333;
  line-height: 1.6;
}

/* Fraction Visualizations */
.frac-visuals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
  text-align: center;
}

.frac-visual-item {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px;
  background-color: #fafbfc;
}

.frac-visual-title {
  font-size: 12.5px;
  font-weight: bold;
  color: #2b5a88;
  margin-bottom: 8px;
}

.frac-svg-pie {
  display: block;
  margin: 0 auto;
}

.frac-number-line {
  margin-top: 16px;
  padding: 12px 14px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

/* Sidebar Styles (Exact Match of Image 2) */
.cur-side-search-form {
  display: flex;
  margin-bottom: 18px;
  position: relative;
}

.cur-side-search-wrap {
  position: relative;
  flex: 1;
}

.cur-side-search-input {
  width: 100%;
  border: 1px solid #7f9db9;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background-color: #ffffff;
  box-sizing: border-box;
}

.cur-side-search-input:focus {
  border-color: #003366;
  box-shadow: 0 0 3px rgba(0, 51, 102, 0.25);
}

.cur-side-search-btn {
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #1b4570;
  border-left: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.cur-side-search-btn:hover {
  background-color: #1b4570;
}

.cur-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #7f9db9;
  border-top: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
}

.cur-search-dropdown.active {
  display: block;
}

.cur-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 9px;
  font-size: 12px;
  color: #222222;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.cur-search-item:hover,
.cur-search-item.highlighted {
  background-color: #eaf1f8;
  color: #003366;
}

.cur-search-item-cat {
  font-size: 10px;
  color: #555555;
  background-color: #edf2f7;
  padding: 1px 5px;
  border-radius: 2px;
}

/* Sidebar Financial Calculators Box (Image 2) */
.cur-side-card {
  border: 1px solid #a3b8cc;
  margin-bottom: 15px;
  background-color: #ffffff;
}

.cur-side-card-title {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 8px;
}

.cur-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px;
  gap: 4px 10px;
  font-size: 12px;
  background-color: #ffffff;
}

.cur-side-card-grid a {
  color: #0844a4;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.cur-side-card-grid a.active-link {
  font-weight: bold;
  color: #000000;
}

.cur-side-card-more {
  border-top: 1px solid #e0e0e0;
  padding: 6px 8px 6px 10px;
  font-size: 11.5px;
  background-color: #f7f9fa;
  text-align: left;
}

.cur-side-card-more a {
  color: #0844a4;
  text-decoration: none;
  font-weight: normal;
}

.cur-side-card-more a:hover {
  text-decoration: underline;
}

.cur-side-card-footer {
  border-top: 1px solid #e0e0e0;
  padding: 6px 8px;
  font-size: 11px;
  color: #555555;
  background-color: #f7f9fa;
  text-align: center;
}

.cur-side-card-footer a {
  color: #0844a4;
  text-decoration: none;
}

.cur-side-card-footer a:hover {
  text-decoration: underline;
}

/* SEO / Educational Content Section */
.cur-seo-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.cur-seo-title {
  font-size: 20px;
  font-weight: bold;
  color: #1a365d;
  margin: 0 0 12px 0;
}

.cur-seo-lead {
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 16px;
}

.cur-seo-h3 {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 20px 0 8px 0;
}

.cur-seo-p {
  font-size: 13px;
  line-height: 1.65;
  color: #444444;
  margin-bottom: 12px;
}

.cur-faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 0;
}

.cur-faq-question {
  font-size: 14px;
  font-weight: bold;
  color: #0844a4;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cur-faq-question:hover {
  color: #002277;
}

.cur-faq-answer {
  font-size: 13px;
  line-height: 1.6;
  color: #444444;
  margin-top: 6px;
  display: none;
}

.cur-faq-answer.open {
  display: block;
}

/* Modal for Saved Calculations */
.cur-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.cur-modal-backdrop.active {
  display: flex;
}

.cur-modal {
  background: #ffffff;
  width: 90%;
  max-width: 600px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.cur-modal-header {
  background: var(--cur-blue-header);
  color: #ffffff;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.cur-modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.cur-modal-footer {
  padding: 10px 16px;
  background: #f7f9fa;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
.cur-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #2b5a88;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 3000;
  pointer-events: none;
}

.cur-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Print Optimization (Requirement 3) */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .site-header,
  .cur-top-actions,
  .cur-nav-tabs,
  .cur-btn-row,
  .cur-checkbox-row,
  .cur-sidebar-col,
  .cur-small-btn,
  .cur-search-filter-input,
  .cur-base-select-row,
  .cur-faq-item,
  .cur-modal-backdrop,
  .cur-toast,
  footer {
    display: none !important;
  }

  .cur-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .cur-main-layout {
    display: block !important;
  }

  .cur-card,
  .cur-table-responsive {
    border: 1px solid #333333 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .cur-instruction-banner {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-bottom: 2px solid #000000 !important;
    padding: 4px 0 !important;
  }

  .cur-result-box {
    background-color: #f0f0f0 !important;
    border: 1px solid #444444 !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .cur-main-layout {
    flex-direction: column;
  }

  .cur-sidebar-col {
    width: 100%;
  }

  .cur-form-table td.label-col {
    width: 75px;
  }

  .cur-input-amt,
  .cur-select {
    width: 100%;
    max-width: 100%;
  }

  .cur-table th,
  .cur-table td {
    padding: 4px 6px;
    font-size: 11px;
  }
}
