/* ==========================================================================
   Conversion Calculator Stylesheet - Calculator Archive
   Exact replica of clean reference layout (Image 2) + Interactive Visualizations,
   Fraction Arithmetic Solver, Saved History Drawer, Print Report & 8-Language Engine
   ========================================================================== */

:root {
  --conv-blue-header: #245580;
  --conv-blue-header-hover: #1a4163;
  --conv-blue-title: #0a3871;
  --conv-blue-link: #0044aa;
  --conv-blue-hover: #002277;
  --conv-box-bg: #f4f4f4;
  --conv-border: #cccccc;
  --conv-input-border: #7f9db9;
  --conv-green-btn: #388e3c;
  --conv-green-hover: #2e7d32;
  --conv-font: Arial, Helvetica, sans-serif;
  --conv-mono: Consolas, "Courier New", Courier, monospace;
}

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

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

.conv-breadcrumbs {
  font-size: 13px;
  color: #666;
}

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

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

.conv-breadcrumbs .sep {
  margin: 0 4px;
  color: #999;
}

.conv-breadcrumbs .current {
  color: #333;
  font-weight: 500;
}

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

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

.conv-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

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

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

/* Page Title & Intro (Image 2) */
.conv-page-title {
  font-size: 26px;
  color: var(--conv-blue-title);
  margin: 0 0 10px 0;
  font-weight: bold;
  letter-spacing: -0.2px;
}

.conv-lead-text {
  font-size: 13px;
  line-height: 1.55;
  color: #333333;
  margin: 0 0 16px 0;
}

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

.conv-lead-text a:hover {
  text-decoration: underline;
}

/* Main 2-Column Grid Layout */
.conv-main-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 24px;
  align-items: start;
}

/* Left Column */
.conv-content-col {
  min-width: 0;
}

/* Tab Navigation (Exact Image 2 Style) */
.conv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.conv-tab-btn {
  background-color: var(--conv-blue-header);
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 16px;
  border: 1px solid #1c4568;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-family: var(--conv-font);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.conv-tab-btn:hover {
  background-color: var(--conv-blue-header-hover);
}

.conv-tab-btn.active {
  background-color: var(--conv-box-bg);
  color: #000000;
  border: 1px solid var(--conv-border);
  border-bottom: 1px solid var(--conv-box-bg);
  cursor: default;
}

/* Calculator Form Box (Exact Image 2 Style) */
.conv-card {
  background-color: var(--conv-box-bg);
  border: 1px solid var(--conv-border);
  border-radius: 0 4px 4px 4px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.conv-converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.conv-col {
  display: flex;
  flex-direction: column;
}

.conv-col-label {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #000000;
}

.conv-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid var(--conv-input-border);
  border-radius: 2px;
  background: #ffffff;
  color: #111;
  font-family: var(--conv-font);
  margin-bottom: 10px;
}

.conv-input:focus {
  outline: 2px solid #2563eb;
  border-color: #2563eb;
}

.conv-listbox {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--conv-input-border);
  border-radius: 2px;
  font-size: 13px;
  font-family: var(--conv-font);
  background: #ffffff;
  height: 220px;
  overflow-y: auto;
  outline: none;
}

.conv-listbox option {
  padding: 4px 8px;
  cursor: pointer;
}

.conv-listbox option:hover {
  background-color: #e0e7ff;
}

.conv-listbox option:checked {
  background-color: #cbd5e1 linear-gradient(0deg, #cbd5e1 0%, #cbd5e1 100%);
  color: #0f172a;
  font-weight: 600;
}

/* Quick Tools Toolbar beneath Converter */
.conv-tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
  gap: 8px;
}

.conv-tool-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.conv-swap-btn {
  background: #ffffff;
  border: 1px solid var(--conv-border);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  color: var(--conv-blue-header);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.conv-swap-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* Result Banner */
.conv-result-banner {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-left: 4px solid var(--conv-green-btn);
  border-radius: 4px;
  padding: 12px 16px;
  margin-top: 16px;
}

.conv-result-main {
  font-size: 18px;
  font-weight: bold;
  color: #166534;
  margin-bottom: 4px;
  word-break: break-word;
}

.conv-result-formula {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
}

/* Visualization Scale & Bar Comparison (Requirement #5) */
.conv-chart-section {
  background: #ffffff;
  border: 1px solid var(--conv-border);
  border-radius: 4px;
  padding: 16px 20px;
  margin-top: 20px;
}

.conv-chart-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--conv-blue-title);
  margin: 0 0 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conv-chart-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;
}

.conv-scale-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conv-scale-row {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.conv-scale-label {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-bar-track {
  background: #e2e8f0;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.conv-bar-fill {
  background: #245580;
  height: 100%;
  border-radius: 7px;
  transition: width 0.3s ease;
}

.conv-scale-val {
  text-align: right;
  font-family: var(--conv-mono);
  font-size: 11.5px;
  color: #475569;
}

/* ==========================================================================
   Section 2: Fraction Arithmetic & Ratio Conversion (Requirement #1, #5, #6)
   ========================================================================== */
.conv-fraction-section {
  background: #ffffff;
  border: 1px solid var(--conv-border);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 24px;
}

.conv-section-header {
  border-bottom: 2px solid #245580;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.conv-section-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--conv-blue-title);
  margin: 0 0 4px 0;
}

.conv-section-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.conv-frac-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 16px;
}

.conv-frac-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
}

.conv-frac-input {
  width: 100%;
  text-align: center;
  padding: 6px 4px;
  font-size: 15px;
  font-weight: bold;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  background: #ffffff;
}

.conv-frac-bar {
  width: 100%;
  height: 2px;
  background: #0f172a;
  margin: 4px 0;
  border: none;
}

.conv-frac-op-select {
  padding: 8px 12px;
  font-size: 18px;
  font-weight: bold;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
}

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

.conv-frac-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.conv-btn-green {
  background: var(--conv-green-btn);
  color: #ffffff;
  border: 1px solid #2e7d32;
  border-radius: 4px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.conv-btn-green:hover {
  background: var(--conv-green-hover);
}

.conv-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.conv-btn-secondary:hover {
  background: #e2e8f0;
}

/* Fraction Results Display */
.conv-frac-result-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.conv-frac-headline {
  font-size: 18px;
  font-weight: bold;
  color: #166534;
  margin-bottom: 10px;
}

.conv-frac-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.conv-frac-detail-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 8px 12px;
  text-align: center;
}

.conv-frac-detail-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.conv-frac-detail-val {
  font-size: 16px;
  font-weight: bold;
  color: #0f172a;
  font-family: var(--conv-mono);
}

.conv-frac-steps {
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  background: #ffffff;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Fraction Visualizations: Pie Charts, Bar and Number Line */
.conv-visualizer-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.conv-vis-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 16px;
  text-align: center;
}

.conv-vis-title {
  font-size: 13px;
  font-weight: bold;
  color: #334155;
  margin-bottom: 8px;
}

.conv-pie-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 10px 0;
}

.conv-number-line-wrap {
  width: 100%;
  padding: 10px 0;
}

/* ==========================================================================
   RIGHT SIDEBAR: Search Form & "Other Calculators" Card (Image 2 Match)
   ========================================================================== */
.conv-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sidebar Search */
.conv-side-search-form {
  display: flex;
  gap: 0;
  position: relative;
}

.conv-side-search-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-right: none;
  border-radius: 0;
  outline: none;
  background: #ffffff;
}

.conv-side-search-input:focus {
  border-color: #2563eb;
}

.conv-side-search-btn {
  background: #245580;
  color: #ffffff;
  border: 1px solid #1a4163;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.conv-side-search-btn:hover {
  background: #1a4163;
}

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

.conv-search-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.conv-search-item:hover {
  background-color: #f8fafc;
}

.conv-search-item-cat {
  font-size: 10.5px;
  color: #64748b;
  text-transform: uppercase;
}

/* "Other Calculators" Card (Exact Image 2 Match) */
.conv-side-card {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.conv-side-card-title {
  background-color: #2b5a88; /* deep blue title bar in Image 2 */
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  padding: 7px 10px;
  letter-spacing: 0.2px;
}

.conv-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 12px;
  row-gap: 6px;
  column-gap: 12px;
}

.conv-side-card-grid a {
  font-size: 13px;
  color: var(--conv-blue-link);
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-side-card-grid a:hover {
  color: var(--conv-blue-hover);
}

.conv-side-card-grid a.active {
  font-weight: bold;
  color: #0f172a;
  text-decoration: none;
}

.conv-side-card-footer {
  background: #e9e9e9;
  border-top: 1px solid #dcdcdc;
  padding: 6px 10px;
  font-size: 11.5px;
  text-align: center;
  color: #555555;
}

.conv-side-card-footer a {
  color: var(--conv-blue-link);
  text-decoration: underline;
  margin: 0 2px;
}

.conv-side-card-footer a:hover {
  color: var(--conv-blue-hover);
}

/* ==========================================================================
   Article & SEO Content Guide (500+ Words, AEO & GEO Schema Ready)
   ========================================================================== */
.conv-guide-article {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 24px;
  margin-top: 24px;
  line-height: 1.65;
  color: #334155;
}

.conv-guide-article h2 {
  font-size: 20px;
  color: var(--conv-blue-title);
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.conv-guide-article h3 {
  font-size: 16px;
  color: #0f172a;
  margin-top: 20px;
  margin-bottom: 8px;
}

.conv-guide-article p {
  margin: 0 0 12px 0;
  font-size: 13.5px;
}

.conv-guide-article ul {
  margin: 0 0 14px 20px;
  padding: 0;
  font-size: 13px;
}

.conv-guide-article li {
  margin-bottom: 6px;
}

/* FAQ Accordion (AEO Ready) */
.conv-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}

.conv-faq-q {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: bold;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.conv-faq-q:hover {
  background: #f1f5f9;
}

.conv-faq-a {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: none;
}

.conv-faq-item.open .conv-faq-a {
  display: block;
}

/* ==========================================================================
   Modals: Saved History & Print Specification Report
   ========================================================================== */
.conv-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.conv-modal-card {
  background: #ffffff;
  border-radius: 6px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  overflow: hidden;
}

.conv-modal-header {
  background: #245580;
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conv-modal-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

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

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

.conv-modal-footer {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 860px) {
  .conv-main-layout {
    grid-template-columns: 1fr;
  }
  .conv-converter-grid {
    grid-template-columns: 1fr;
  }
  .conv-visualizer-container {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }
  .site-header, .conv-top-actions, .conv-sidebar-col, .site-footer, .conv-tools-row, .conv-modal-overlay, .conv-toast, .conv-frac-actions {
    display: none !important;
  }
  .conv-main-layout {
    grid-template-columns: 1fr !important;
  }
  .conv-card, .conv-fraction-section, .conv-chart-section {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
  }
}
