/**
 * Compound Interest Calculator Stylesheet
 * Calculator Archive - Pixel-accurate clone matching Calculator.net design
 */

/* Screen reader only utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Container & Layout */
.ci-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 16px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  box-sizing: border-box;
}

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

.ci-breadcrumbs {
  color: #0844a4;
  font-size: 13px;
}

.ci-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

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

.ci-breadcrumbs .sep {
  color: #888888;
  margin: 0 4px;
}

.ci-breadcrumbs .current {
  color: #555555;
}

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

.ci-saved-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #2b5a88;
  background: #f5f7fa;
  border: 1px solid #ccd5df;
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.ci-saved-btn:hover {
  background: #eaf0f7;
  border-color: #a9b9cb;
}

.ci-print-link {
  font-size: 13px;
  color: #0844a4;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.ci-print-link:hover {
  color: #cc0000;
}

/* Page Title & Intro */
.ci-page-title {
  font-size: 24px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.ci-intro-text {
  font-size: 13px;
  line-height: 1.5;
  color: #222222;
  margin-bottom: 16px;
}

.ci-intro-text a {
  color: #0844a4;
  text-decoration: underline;
}

.ci-intro-text a:hover {
  color: #cc0000;
}

/* Main Layout: 2 Columns */
.ci-main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

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

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

/* Calculator Box - Faithful clone of Screenshot 2 */
.ci-calc-card {
  background-color: #f2f4f7;
  border: 1px solid #c8d2dc;
  border-radius: 0px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.ci-converter-table {
  width: auto;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.ci-converter-table th {
  font-size: 13px;
  font-weight: bold;
  color: #333333;
  text-align: left;
  padding: 0 10px 8px 0;
  white-space: nowrap;
}

.ci-converter-table td {
  padding: 0 10px 0 0;
  vertical-align: middle;
  white-space: nowrap;
}

.ci-converter-table .ci-eq-cell {
  padding: 0 12px 0 2px;
  font-size: 17px;
  font-weight: bold;
  color: #000000;
  text-align: center;
}

/* Input Fields */
.ci-rate-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ci-rate-input {
  width: 65px;
  height: 24px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #7f9db9;
  background-color: #ffffff;
  box-sizing: border-box;
  color: #000000;
}

.ci-rate-input:focus {
  outline: 1px solid #204a79;
}

.ci-pct-sign {
  font-size: 13px;
  color: #000000;
}

.ci-select {
  height: 24px;
  padding: 1px 4px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #7f9db9;
  background-color: #ffffff;
  color: #000000;
  box-sizing: border-box;
  cursor: pointer;
}

.ci-select:focus {
  outline: 1px solid #204a79;
}

/* Green Output Text */
.ci-output-cell {
  padding: 0 12px 0 0;
}

.ci-output-rate {
  font-size: 15px;
  font-weight: bold;
  color: #137d16;
  display: inline-block;
  min-width: 75px;
  letter-spacing: -0.2px;
}

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

.ci-btn-calc {
  background-color: #3b7a1e;
  color: #ffffff;
  border: 1px solid #2f6517;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  line-height: 1.2;
}

.ci-btn-calc:hover {
  background-color: #326919;
}

.ci-play-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #ffffff;
  margin-left: 2px;
}

.ci-btn-clear {
  background-color: #8a959e;
  color: #ffffff;
  border: 1px solid #778189;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
  border-radius: 2px;
  line-height: 1.2;
}

.ci-btn-clear:hover {
  background-color: #78828b;
}

.ci-btn-swap {
  background-color: #ffffff;
  color: #2b5a88;
  border: 1px solid #7f9db9;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
}

.ci-btn-swap:hover {
  background-color: #edf3f8;
}

.ci-btn-save {
  background-color: #ffffff;
  color: #2b5a88;
  border: 1px solid #7f9db9;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
}

.ci-btn-save:hover {
  background-color: #edf3f8;
}

/* Result summary bar */
.ci-summary-callout {
  margin-top: 14px;
  padding: 10px 14px;
  background-color: #eaf3ff;
  border: 1px solid #b2d2f7;
  font-size: 13px;
  line-height: 1.5;
  color: #103862;
}

.ci-summary-callout strong {
  color: #003366;
}

/* Preset Quick Buttons */
.ci-presets-bar {
  margin-top: 12px;
  font-size: 12px;
  color: #555555;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ci-preset-btn {
  background: #ffffff;
  border: 1px solid #ccd5df;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 11.5px;
  color: #0844a4;
  cursor: pointer;
}

.ci-preset-btn:hover {
  background: #f0f4f8;
  border-color: #99b2cc;
}

/* Equivalence Matrix & Schedules */
.ci-section-card {
  margin-top: 24px;
  margin-bottom: 24px;
}

.ci-section-header {
  font-size: 17px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 10px 0;
  border-bottom: 1px solid #d4dde6;
  padding-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ci-table-actions {
  font-size: 12px;
  font-weight: normal;
}

.ci-csv-btn {
  background: #ffffff;
  border: 1px solid #7f9db9;
  color: #0844a4;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11.5px;
  cursor: pointer;
}

.ci-csv-btn:hover {
  background: #eef4f9;
}

.ci-schedule-table-wrap {
  overflow-x: auto;
  border: 1px solid #c8d2dc;
  margin-bottom: 16px;
}

.ci-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.ci-schedule-table th {
  background-color: #e2e8f0;
  color: #1a365d;
  padding: 7px 10px;
  border: 1px solid #ccd5df;
  font-weight: bold;
  white-space: nowrap;
}

.ci-schedule-table td {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

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

.ci-schedule-table tr.highlight-row {
  background-color: #edf7ed;
  font-weight: bold;
}

.ci-schedule-table tr.highlight-row td {
  color: #137d16;
}

.ci-schedule-table .text-right {
  text-align: right;
}

.ci-schedule-table .text-center {
  text-align: center;
}

/* Interactive Canvas Chart */
.ci-chart-box {
  border: 1px solid #c8d2dc;
  background-color: #ffffff;
  padding: 16px;
  margin-bottom: 24px;
}

.ci-chart-header {
  font-size: 14px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ci-chart-canvas {
  width: 100%;
  height: 240px;
  display: block;
}

/* Educational Info Section */
.ci-info-section {
  font-size: 13px;
  line-height: 1.6;
  color: #222222;
  margin-top: 24px;
}

.ci-info-section h2 {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 20px 0 8px 0;
  border-bottom: 1px solid #e0e5eb;
  padding-bottom: 4px;
}

.ci-info-section h2:first-child {
  margin-top: 0;
}

.ci-info-section p {
  margin: 0 0 12px 0;
}

.ci-info-section ul {
  margin: 0 0 14px 20px;
  padding: 0;
}

.ci-info-section li {
  margin-bottom: 6px;
}

.ci-formula-box {
  background-color: #f5f7fa;
  border-left: 3px solid #204a79;
  padding: 10px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 10px 0 16px 0;
  color: #111111;
}

/* Sidebar Styles */
.ci-search-box {
  display: flex;
  margin-bottom: 16px;
}

.ci-search-input {
  flex: 1;
  height: 26px;
  padding: 2px 8px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  box-sizing: border-box;
}

.ci-search-input:focus {
  outline: 1px solid #204a79;
}

.ci-search-btn {
  height: 26px;
  padding: 0 12px;
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #204a79;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-sizing: border-box;
}

.ci-search-btn:hover {
  background-color: #1f4264;
}

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

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

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

.ci-search-item .ci-cat-tag {
  color: #888888;
  font-size: 11px;
}

/* Sidebar Card */
.ci-sidebar-card {
  border: 1px solid #7f9db9;
  margin-bottom: 16px;
  background: #ffffff;
}

.ci-sidebar-header {
  background-color: #204a79;
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 10px;
}

.ci-sidebar-content {
  padding: 10px 12px;
}

.ci-sidebar-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
}

.ci-sidebar-links-grid a {
  color: #0844a4;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.ci-sidebar-links-grid a.active-link {
  font-weight: bold;
  color: #000000;
}

.ci-sidebar-more {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid #e0e5eb;
  font-size: 12px;
}

.ci-sidebar-more a {
  color: #0844a4;
  text-decoration: none;
}

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

.ci-sidebar-cats {
  background: #f5f7fa;
  border-top: 1px solid #ccd5df;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #666666;
  text-align: center;
}

.ci-sidebar-cats a {
  color: #0844a4;
  text-decoration: none;
}

.ci-sidebar-cats a:hover {
  text-decoration: underline;
}

.ci-sidebar-cats .sep {
  margin: 0 3px;
  color: #999999;
}

/* Modals */
.ci-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
}

.ci-modal-dialog {
  background: #ffffff;
  border: 1px solid #7f9db9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.ci-modal-header {
  background: #204a79;
  color: #ffffff;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ci-modal-header h3 {
  margin: 0;
  font-size: 14px;
  color: #ffffff;
}

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

.ci-modal-body {
  padding: 16px;
  overflow-y: auto;
  font-size: 13px;
}

.ci-modal-footer {
  padding: 8px 12px;
  background: #f5f7fa;
  border-top: 1px solid #ccd5df;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ci-saved-scenario-card {
  border: 1px solid #ccd5df;
  background: #f9fbfe;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ci-saved-scenario-title {
  font-weight: bold;
  color: #003366;
  margin-bottom: 4px;
}

.ci-saved-scenario-meta {
  font-size: 11.5px;
  color: #555555;
}

.ci-saved-scenario-actions {
  display: flex;
  gap: 6px;
}

.ci-btn-sm {
  padding: 3px 8px;
  font-size: 11.5px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid #7f9db9;
  background: #ffffff;
  color: #0844a4;
}

.ci-btn-sm.delete {
  color: #cc0000;
  border-color: #d88;
}

.ci-btn-sm:hover {
  background: #f0f4f8;
}

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

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

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

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

  .ci-converter-table {
    width: 100%;
  }

  .ci-converter-table th,
  .ci-converter-table td {
    display: block;
    padding: 4px 0;
  }

  .ci-converter-table .ci-eq-cell {
    text-align: left;
    padding: 6px 0;
  }
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  .site-header,
  .site-footer,
  .ci-top-actions,
  .ci-sidebar-col,
  .ci-btn-row,
  .ci-presets-bar,
  .ci-table-actions,
  .ci-toast {
    display: none !important;
  }

  .ci-modal-backdrop {
    display: none !important;
  }

  /* When printing from modal */
  body.ci-printing-modal .ci-page-container {
    display: none !important;
  }

  body.ci-printing-modal #ci-print-modal {
    position: static !important;
    background: transparent !important;
    display: block !important;
    padding: 0 !important;
  }

  body.ci-printing-modal .ci-modal-dialog {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
  }

  body.ci-printing-modal .ci-modal-body {
    overflow: visible !important;
    padding: 0 !important;
  }

  body.ci-printing-modal .ci-modal-header,
  body.ci-printing-modal .ci-modal-footer,
  body.ci-printing-modal div[style*="display: flex; gap: 10px"] {
    display: none !important;
  }

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

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

  .ci-content-col {
    width: 100% !important;
  }

  .ci-calc-card {
    border: 1px solid #000000 !important;
    background: #ffffff !important;
  }

  .ci-schedule-table th {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
  }

  .ci-schedule-table td {
    border-color: #888888 !important;
  }
}
