/* Auto Loan Calculator Styles - Calculator.net Pixel-Perfect Clone Matching Image */

.alc-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 15px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
  box-sizing: border-box;
}

/* Top Breadcrumb & Print Row */
.alc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.alc-breadcrumbs {
  color: #0844a4;
}

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

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

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

.alc-breadcrumbs .current {
  color: #333333;
}

.alc-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.alc-print-link:hover {
  color: #002266;
}

.alc-saved-btn {
  background: #f4f6f8;
  border: 1px solid #b5c7d8;
  color: #003366;
  font-size: 11.5px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.alc-saved-btn:hover {
  background: #e2eaf2;
}

/* Page Title */
.alc-page-title {
  font-size: 24px;
  color: #003366;
  font-weight: bold;
  margin: 0 0 16px 0;
  padding: 0;
}

/* Main Layout Grid: Form + Results on Left/Center, Sidebar on Right */
.alc-main-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
}

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

/* Top Section: Form Box & Results Box side-by-side */
.alc-calc-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Form Container & Tabs */
.alc-form-container {
  width: 320px;
  flex-shrink: 0;
}

.alc-tabs {
  display: flex;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.alc-tab {
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid #c1c9d3;
  text-decoration: none;
  display: inline-block;
  user-select: none;
}

.alc-tab.active {
  background-color: #f4f6f8;
  color: #000000;
  font-weight: bold;
  border-bottom: 1px solid #f4f6f8;
}

.alc-tab.inactive {
  background-color: #2b5a88;
  color: #ffffff;
  border-color: #2b5a88;
  font-weight: bold;
}

.alc-tab.inactive:hover {
  background-color: #234b73;
}

.alc-form-box {
  background-color: #f4f6f8;
  border: 1px solid #c1c9d3;
  padding: 12px 14px;
  box-sizing: border-box;
}

.alc-form-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.alc-form-table td {
  padding: 4px 2px;
  vertical-align: middle;
  font-size: 12.5px;
}

.alc-form-table td:first-child {
  width: 58%;
  color: #222222;
  white-space: nowrap;
}

.alc-form-table td:last-child {
  width: 42%;
  text-align: right;
}

.alc-help-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  line-height: 13px;
  border-radius: 50%;
  background: #777;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  text-align: center;
  margin-left: 2px;
  cursor: help;
  vertical-align: middle;
  text-decoration: none;
}

.alc-input-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #7f9db9;
  border-radius: 1px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 4px;
  height: 24px;
}

.alc-input-group:focus-within {
  border-color: #003366;
  outline: 1px solid #003366;
}

.alc-input-symbol {
  font-size: 12px;
  color: #555555;
  user-select: none;
  padding-right: 2px;
}

.alc-input-unit {
  font-size: 11px;
  color: #555555;
  user-select: none;
  padding-left: 3px;
}

.alc-input {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  font-family: inherit;
  color: #000000;
  text-align: right;
  padding: 0 2px;
  box-sizing: border-box;
}

.alc-select {
  width: 100%;
  height: 24px;
  border: 1px solid #7f9db9;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
  box-sizing: border-box;
  padding: 1px 2px;
  outline: none;
}

.alc-checkbox-row {
  padding-top: 6px !important;
  font-size: 11.5px !important;
  color: #333333;
  line-height: 1.3;
}

.alc-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.alc-calc-btn-wrap {
  text-align: center;
  padding-top: 10px !important;
}

.alc-calculate-btn {
  background: linear-gradient(to bottom, #5c9038 0%, #3e6d24 100%);
  color: #ffffff;
  border: 1px solid #32581c;
  border-radius: 3px;
  padding: 5px 22px;
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.alc-calculate-btn:hover {
  background: linear-gradient(to bottom, #69a341 0%, #467b2a 100%);
}

.alc-calculate-btn:active {
  background: #3e6d24;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.alc-btn-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #ffffff;
}

/* Results Box (Middle Column) */
.alc-results-container {
  flex: 1;
  min-width: 300px;
  max-width: 380px;
}

.alc-results-header {
  background-color: #5c9038;
  color: #ffffff;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 2px 2px 0 0;
}

.alc-results-header-text {
  font-size: 16px;
  font-weight: bold;
}

.alc-save-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 2px;
  cursor: pointer;
}

.alc-save-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

.alc-results-body {
  border: 1px solid #d4dbe0;
  border-top: none;
  background: #ffffff;
  padding: 8px 12px 14px;
}

.alc-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.alc-breakdown-table td {
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}

.alc-breakdown-table td.label {
  color: #222222;
}

.alc-breakdown-table td.val {
  text-align: right;
  font-weight: normal;
  color: #111111;
}

.alc-breakdown-table tr.separator td {
  padding: 4px 0;
  border-bottom: none;
}

/* Loan Breakdown Donut Chart */
.alc-chart-section {
  text-align: center;
  padding-top: 4px;
}

.alc-chart-title {
  font-size: 14px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 8px;
}

.alc-donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.alc-donut-svg {
  width: 110px;
  height: 110px;
}

.alc-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  text-align: left;
}

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

.alc-legend-box {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex-shrink: 0;
}

.alc-legend-box.principal {
  background-color: #2b5a88;
}

.alc-legend-box.interest {
  background-color: #8bc34a;
}

.alc-legend-box.payment {
  background-color: #8b1e1e;
}

.alc-state-tax-link {
  display: block;
  text-align: left;
  font-size: 12px;
  color: #0844a4;
  text-decoration: underline;
  margin-top: 10px;
  cursor: pointer;
}

.alc-state-tax-link:hover {
  color: #002266;
}

/* Bottom Section: Amortization Schedule & Chart */
.alc-schedule-section {
  margin-top: 10px;
}

.alc-schedule-heading {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 8px 0;
}

.alc-schedule-tabs {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.alc-schedule-tab {
  cursor: pointer;
  color: #0844a4;
  text-decoration: underline;
}

.alc-schedule-tab.active {
  color: #000000;
  font-weight: bold;
  text-decoration: none;
  cursor: default;
}

.alc-schedule-grid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.alc-table-wrap {
  flex: 1;
  min-width: 290px;
}

.alc-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.alc-schedule-table th {
  background-color: #2b5a88;
  color: #ffffff;
  padding: 5px 8px;
  font-weight: bold;
  text-align: right;
  border: 1px solid #234b73;
}

.alc-schedule-table th:first-child {
  text-align: center;
}

.alc-schedule-table td {
  padding: 4px 8px;
  border: 1px solid #d4dbe0;
  text-align: right;
  color: #222222;
}

.alc-schedule-table td:first-child {
  text-align: center;
  background-color: #f7f9fa;
}

.alc-schedule-table tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

.alc-schedule-table tbody tr:hover {
  background-color: #edf3f8;
}

/* Line Chart */
.alc-line-chart-wrap {
  width: 320px;
  flex-shrink: 0;
  text-align: center;
}

.alc-chart-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 11.5px;
  margin-bottom: 6px;
}

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

.alc-chart-legend-line {
  width: 18px;
  height: 3px;
  display: inline-block;
}

.alc-chart-legend-line.balance {
  background-color: #2b5a88;
}

.alc-chart-legend-line.interest {
  background-color: #8bc34a;
}

.alc-chart-legend-line.payment {
  background-color: #8b1e1e;
}

.alc-line-chart-svg {
  width: 320px;
  height: 220px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
}

/* Sidebar Column (Right) */
.alc-sidebar-col {
  width: 250px;
  flex-shrink: 0;
}

/* Search Box */
.alc-search-box {
  display: flex;
  margin-bottom: 18px;
}

.alc-search-input {
  flex: 1;
  height: 26px;
  border: 1px solid #7f9db9;
  border-right: none;
  padding: 0 6px;
  font-size: 12px;
  box-sizing: border-box;
  outline: none;
}

.alc-search-input:focus {
  border-color: #003366;
}

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

.alc-search-btn:hover {
  background-color: #1e4265;
}

.alc-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  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: 1000;
}

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

.alc-search-item {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.alc-search-item:hover,
.alc-search-item.highlighted {
  background-color: #edf3f8;
  color: #003366;
}

.alc-search-item-cat {
  color: #888;
  font-size: 10.5px;
}

/* Sidebar Card */
.alc-sidebar-card {
  border: 1px solid #b2c2d4;
  margin-bottom: 18px;
}

.alc-sidebar-card-header {
  background-color: #003366;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: bold;
  padding: 6px 10px;
}

.alc-sidebar-card-body {
  background-color: #ffffff;
  padding: 8px 10px;
}

.alc-sidebar-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  row-gap: 4px;
}

.alc-sidebar-links-grid a {
  color: #0844a4;
  text-decoration: underline;
  font-size: 11.5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alc-sidebar-links-grid a:hover {
  color: #002266;
}

.alc-sidebar-footer-links {
  border-top: 1px solid #e0e5eb;
  padding: 8px 10px;
  background-color: #f2f5f8;
  font-size: 11px;
  color: #555555;
}

.alc-sidebar-footer-links a {
  color: #0844a4;
  text-decoration: underline;
}

.alc-sidebar-footer-links a:hover {
  color: #002266;
}

/* Modals for Saved & Print */
.alc-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.alc-modal-dialog {
  background: #ffffff;
  border: 1px solid #003366;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.alc-modal-dialog-lg {
  max-width: 760px;
  max-height: 92vh;
}

.alc-modal-header {
  background: #003366;
  color: #ffffff;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alc-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
}

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

.alc-modal-body {
  padding: 14px;
  overflow-y: auto;
  font-size: 12.5px;
}

.alc-print-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e5eb;
  background-color: #f8fafc;
  padding: 8px 10px;
  border-radius: 3px;
}

.alc-print-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #7f9db9;
  padding: 5px 12px;
  font-size: 12px;
  color: #003366;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
}

.alc-print-action-btn:hover {
  background: #eef3f8;
  border-color: #003366;
}

.alc-print-action-btn.alc-btn-print-now {
  background: #5c9038;
  border-color: #4a752d;
  color: #ffffff;
}

.alc-print-action-btn.alc-btn-print-now:hover {
  background: #4a752d;
}

.alc-print-sheet {
  background: #ffffff;
  padding: 6px 2px;
  color: #111111;
}

.alc-print-tip {
  font-size: 11px;
  color: #666666;
  margin-right: auto;
  align-self: center;
}

.alc-modal-footer {
  background: #f4f6f8;
  border-top: 1px solid #d4dbe0;
  padding: 8px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.alc-modal-btn {
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #7f9db9;
  background: #ffffff;
  color: #333333;
}

.alc-modal-btn.primary {
  background: #003366;
  color: #ffffff;
  border-color: #003366;
  font-weight: bold;
}

/* Toast */
.alc-toast {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #003366;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  z-index: 10000;
  animation: alcFadeIn 0.2s ease-out;
}

@keyframes alcFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Media Queries for Responsiveness */
@media (max-width: 960px) {
  .alc-main-layout {
    flex-direction: column;
  }
  .alc-sidebar-col {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .alc-calc-row {
    flex-direction: column;
  }
  .alc-form-container,
  .alc-results-container {
    width: 100%;
    max-width: 100%;
  }
  .alc-schedule-grid {
    flex-direction: column;
  }
  .alc-line-chart-wrap {
    width: 100%;
  }
  .alc-line-chart-svg {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  /* When Print Modal is Active */
  body.alc-printing-modal .site-header,
  body.alc-printing-modal .alc-top-bar,
  body.alc-printing-modal .alc-page-title,
  body.alc-printing-modal .alc-main-layout,
  body.alc-printing-modal .site-footer,
  body.alc-printing-modal .alc-toast,
  body.alc-printing-modal #saved-modal {
    display: none !important;
  }

  body.alc-printing-modal #alc-print-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  body.alc-printing-modal .alc-modal-dialog-lg {
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none !important;
  }

  body.alc-printing-modal .alc-modal-header,
  body.alc-printing-modal .alc-modal-footer,
  body.alc-printing-modal .alc-print-toolbar,
  body.alc-printing-modal .alc-modal-close-icon {
    display: none !important;
  }

  body.alc-printing-modal .alc-modal-body {
    padding: 0 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* When Direct Page Print is Triggered */
  body:not(.alc-printing-modal) .site-header,
  body:not(.alc-printing-modal) .alc-top-actions,
  body:not(.alc-printing-modal) .alc-print-link,
  body:not(.alc-printing-modal) .alc-sidebar-col,
  body:not(.alc-printing-modal) .alc-tabs,
  body:not(.alc-printing-modal) .alc-calc-btn-wrap,
  body:not(.alc-printing-modal) .site-footer,
  body:not(.alc-printing-modal) .alc-modal-backdrop,
  body:not(.alc-printing-modal) .alc-toast {
    display: none !important;
  }

  body:not(.alc-printing-modal) .alc-page-container {
    max-width: 100%;
    padding: 0;
  }

  body:not(.alc-printing-modal) .alc-main-layout {
    display: block;
  }

  body:not(.alc-printing-modal) .alc-content-col {
    width: 100%;
  }

  body:not(.alc-printing-modal) .alc-results-header {
    background-color: #333333 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
