/* Roth IRA Calculator Styles - Exact Calculator Archive Standard */

:root {
  --k-navy: #1b365d;
  --k-blue-header: #2f5c94;
  --k-blue-subhdr: #3b73af;
  --k-blue-link: #0844a4;
  --k-blue-link-hover: #002277;
  --k-green-header: #2f8027;
  --k-green-btn: #2f8027;
  --k-green-btn-hover: #266b20;
  --k-gray-btn: #e2e8f0;
  --k-gray-btn-hover: #cbd5e1;
  --k-border: #cbd5e1;
  --k-border-dark: #7f9db9;
  --k-bg-light: #f8fafc;
  --k-bg-alt: #f1f5f9;
  --k-text: #333333;
  --k-text-dark: #0f172a;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--k-text);
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.k-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

/* Breadcrumbs Row */
.k-breadcrumbs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

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

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

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

.k-breadcrumbs span {
  color: #777777;
  margin: 0 4px;
}

.k-breadcrumbs .crumb-current {
  color: #333333;
}

/* Top Actions */
.k-top-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.k-top-link-btn:hover {
  color: var(--k-blue-link-hover);
}

/* Page Title & Intro */
.k-main-title {
  font-size: 24px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.k-main-desc {
  font-size: 13.5px;
  color: #333333;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

/* Two-Column Grid */
.k-layout-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .k-layout-grid {
    grid-template-columns: 1fr;
  }
}

.k-content-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* Top Grid: Form + Results Side by Side */
.k-calc-top-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 760px) {
  .k-calc-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Calculator Form Box */
.k-calc-box {
  background: #fdfdfd;
  border: 1px solid #9bb5cf;
  padding: 12px 14px 16px;
  box-sizing: border-box;
  font-size: 13px;
}

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

.k-form-table tr td {
  padding: 5px 2px;
  vertical-align: middle;
}

.k-label-td {
  font-size: 13px;
  color: #333333;
  width: 58%;
  white-space: nowrap;
}

.k-label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Tooltip icon */
.k-tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0844a4;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  position: relative;
  text-decoration: none;
  line-height: 1;
}

.k-tip-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: normal;
  border-radius: 4px;
  white-space: normal;
  width: 200px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
}

.k-input-td {
  width: 42%;
  text-align: left;
}

.k-input {
  width: 86px;
  padding: 3px 6px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  box-sizing: border-box;
  color: #111111;
  background-color: #ffffff;
}

.k-input:focus {
  outline: 1px solid #2f8027;
  border-color: #2f8027;
}

.k-radio-group {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.k-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.k-btn-bar {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.k-calc-btn {
  background-color: var(--k-green-btn);
  color: #ffffff;
  border: 1px solid #1e5a19;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.k-clear-btn {
  background-color: #f1f5f9;
  color: #333333;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 3px;
  cursor: pointer;
}

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

/* Result Box */
.k-result-box {
  background: #ffffff;
  border: 1px solid #9bb5cf;
  box-sizing: border-box;
}

.k-result-header {
  background-color: var(--k-green-header);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.k-save-icon-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  padding: 0;
  line-height: 1;
}

.k-save-icon-btn:hover {
  opacity: 0.85;
}

.k-result-body {
  padding: 12px;
}

/* Results Comparison Table */
.k-res-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
}

.k-res-table th {
  text-align: right;
  padding: 5px 8px;
  font-weight: bold;
  color: #111111;
  border-bottom: 1px solid #d1d5db;
}

.k-res-table th:first-child {
  text-align: left;
}

.k-res-table td {
  padding: 5px 8px;
  text-align: right;
  border-bottom: 1px solid #f1f5f9;
}

.k-res-table td:first-child {
  text-align: left;
  color: #333333;
}

.k-res-highlight {
  font-weight: bold;
  color: #0f172a;
  background-color: #f8fafc;
}

.k-res-summary-note {
  font-size: 12.5px;
  color: #333333;
  margin: 10px 0 14px 0;
  line-height: 1.45;
  background: #f8fafc;
  padding: 8px 10px;
  border-left: 3px solid var(--k-green-btn);
}

/* Graph Card */
.k-graph-container {
  position: relative;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.k-graph-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #333333;
  margin-bottom: 8px;
  padding-left: 35px;
}

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

.k-legend-swatch {
  width: 16px;
  height: 3px;
  display: inline-block;
}

.k-swatch-roth {
  background: #1d4ed8;
}

.k-swatch-taxable {
  background: #0284c7;
}

.k-swatch-principal {
  background: #16a34a;
}

.k-chart-svg {
  width: 100%;
  height: 220px;
  display: block;
}

/* Annual Schedule Section */
.k-schedule-section {
  background: #ffffff;
  border: 1px solid #9bb5cf;
  padding: 14px;
}

.k-schedule-title {
  font-size: 17px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 10px 0;
}

.k-table-scroll {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
}

.k-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: right;
}

.k-schedule-table thead {
  position: sticky;
  top: 0;
  background: #e2e8f0;
  z-index: 2;
}

.k-schedule-table th {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  font-weight: bold;
  color: #1e293b;
  background: #f1f5f9;
  text-align: center;
}

.k-schedule-table td {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  color: #333333;
}

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

.k-schedule-table tr:hover {
  background-color: #f1f5f9;
}

.k-schedule-table td:first-child {
  text-align: center;
  font-weight: 600;
}

/* Fraction Arithmetic Section */
.k-fraction-card {
  background: #f8fafc;
  border: 1px solid #9bb5cf;
  padding: 16px;
  box-sizing: border-box;
}

.k-fraction-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.k-fraction-input-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 48px;
}

.k-fraction-input-group input {
  width: 44px;
  text-align: center;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #7f9db9;
}

.k-fraction-bar {
  width: 40px;
  height: 2px;
  background: #1e293b;
  margin: 4px 0;
}

.k-fraction-op-select {
  padding: 4px 6px;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #7f9db9;
  background: #ffffff;
  cursor: pointer;
}

.k-fraction-equal {
  font-size: 20px;
  font-weight: bold;
  color: #1e293b;
}

.k-fraction-result-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  background: #ffffff;
  border: 2px solid #0844a4;
  border-radius: 4px;
  min-width: 48px;
}

.k-fraction-res-num,
.k-fraction-res-den {
  font-size: 15px;
  font-weight: bold;
  color: #0844a4;
}

.k-fraction-res-bar {
  width: 36px;
  height: 2px;
  background: #0844a4;
  margin: 2px 0;
}

.k-fraction-details {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
}

/* SEO Content Section */
.k-seo-container {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding-top: 18px;
}

.k-seo-title {
  font-size: 20px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 12px 0;
}

.k-seo-subtitle {
  font-size: 16px;
  font-weight: bold;
  color: #1e293b;
  margin: 18px 0 8px 0;
}

.k-seo-text p {
  font-size: 13.5px;
  color: #333333;
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.k-seo-text ul,
.k-seo-text ol {
  font-size: 13.5px;
  color: #333333;
  line-height: 1.6;
  margin: 0 0 14px 24px;
  padding: 0;
}

.k-seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 14px 0 18px 0;
}

.k-seo-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: bold;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.k-seo-table td {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

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

.k-faq-item {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.k-faq-question {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: bold;
  color: #0844a4;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.k-faq-question:hover {
  background: #f1f5f9;
}

.k-faq-answer {
  padding: 12px 14px;
  font-size: 13px;
  color: #333333;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  line-height: 1.55;
}

/* Right Sidebar */
.k-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.k-sidebar-search-box {
  display: flex;
  border: 1px solid #7f9db9;
  background: #ffffff;
}

.k-search-input-field {
  flex: 1;
  border: none;
  padding: 5px 8px;
  font-size: 12.5px;
  outline: none;
}

.k-search-submit-btn {
  background: #e2e8f0;
  border: none;
  border-left: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 10px;
  cursor: pointer;
}

.k-search-submit-btn:hover {
  background: #cbd5e1;
}

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

.k-search-dropdown.show {
  display: block;
}

.k-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #1e3a8a;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
}

.k-search-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Sidebar Financial Links Card */
.k-sidebar-card {
  border: 1px solid #9bb5cf;
  background: #ffffff;
}

.k-sidebar-header {
  background-color: var(--k-blue-subhdr);
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 8px;
}

.k-sidebar-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6px 4px;
}

.k-sidebar-link {
  font-size: 12px;
  color: var(--k-blue-link);
  text-decoration: none;
  padding: 3px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.k-sidebar-link:hover {
  text-decoration: underline;
}

.k-sidebar-tabs {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
}

.k-sidebar-tabs a {
  color: var(--k-blue-link);
  text-decoration: none;
}

.k-sidebar-tabs a:hover {
  text-decoration: underline;
}

/* Modals */
.k-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}

.k-modal-overlay.show {
  display: flex;
}

.k-modal-box {
  background: #ffffff;
  border: 1px solid #9bb5cf;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 500px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

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

.k-modal-body {
  padding: 16px;
  font-size: 13px;
  max-height: 80vh;
  overflow-y: auto;
}

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

/* Toast */
.k-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.k-toast.show {
  opacity: 1;
}

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

[dir="rtl"] .k-top-links,
[dir="rtl"] .k-res-table th,
[dir="rtl"] .k-res-table td,
[dir="rtl"] .k-schedule-table th,
[dir="rtl"] .k-schedule-table td {
  direction: rtl;
}

[dir="rtl"] .k-res-summary-note {
  border-left: none;
  border-right: 3px solid var(--k-green-btn);
}

[dir="rtl"] .k-graph-legend {
  padding-left: 0;
  padding-right: 35px;
}

/* Print Stylesheet */
@media print {
  .site-header,
  .k-sidebar-col,
  .k-breadcrumbs-row .k-top-links,
  .k-btn-bar,
  .k-modal-overlay,
  .site-footer,
  .k-fraction-card {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

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

  .k-layout-grid {
    grid-template-columns: 1fr !important;
  }

  .k-calc-top-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .k-table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }
}
