/**
 * Depreciation Calculator - Stylesheet
 * Classic, clean design matching Calculator.net financial suite
 */

/* ==========================================================================
   Page Layout & Typography
   ========================================================================== */
.dep-page-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 20px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

.dep-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.dep-breadcrumbs {
  font-size: 12.5px;
  color: #006699;
}

.dep-breadcrumbs a {
  color: #006699;
  text-decoration: none;
}

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

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

.dep-breadcrumbs .current {
  color: #006699;
  font-weight: normal;
}

.dep-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dep-top-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.dep-top-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.dep-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.dep-section-subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: #333333;
  margin: 0 0 18px 0;
}

/* ==========================================================================
   Two-Column Main Grid
   ========================================================================== */
.dep-main-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 28px;
  align-items: start;
}

.dep-content-col {
  min-width: 0;
}

/* ==========================================================================
   Calculator Form Box & Result Layout
   ========================================================================== */
.dep-calc-flex {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.dep-calc-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.dep-form-box {
  background: #f2f2f2;
  border: 1px solid #c0c0c0;
  padding: 16px 18px;
  border-radius: 2px;
  min-width: 360px;
  box-sizing: border-box;
}

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

.dep-form-table td {
  padding: 6px 4px;
  vertical-align: middle;
  font-size: 13px;
  color: #222222;
}

.dep-form-table td:first-child {
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
  font-weight: normal;
}

.dep-tooltip-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  line-height: 13px;
  border-radius: 50%;
  border: 1px solid #888888;
  color: #666666;
  font-size: 10px;
  text-align: center;
  cursor: help;
  margin-left: 3px;
  position: relative;
  vertical-align: middle;
  background: #ffffff;
}

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

.dep-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dep-input {
  width: 140px;
  height: 25px;
  border: 1px solid #8c9ba5;
  padding: 2px 6px;
  font-size: 13px;
  border-radius: 1px;
  background: #ffffff;
  color: #111111;
  box-sizing: border-box;
}

.dep-input:focus, .dep-select:focus {
  outline: none;
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.4);
}

.dep-select {
  height: 25px;
  border: 1px solid #8c9ba5;
  padding: 2px 4px;
  font-size: 12.5px;
  border-radius: 1px;
  background: #ffffff;
  color: #111111;
  max-width: 200px;
  box-sizing: border-box;
}

.dep-checkbox-label {
  font-size: 12px;
  color: #444;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.dep-btn-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  padding-left: 6px;
}

.dep-btn-calculate {
  background: #25832a;
  color: #ffffff;
  border: 1px solid #1c6620;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dep-btn-calculate:hover {
  background: #1e6e22;
}

.dep-play-icon {
  font-size: 9px;
  line-height: 1;
}

.dep-btn-clear {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
}

.dep-btn-clear:hover {
  background: #cbd5e1;
}

/* ==========================================================================
   Results Box
   ========================================================================== */
.dep-results-box {
  background: #fdfdfd;
  border: 1px solid #c9d7e1;
  border-radius: 2px;
  padding: 16px;
  flex: 1;
  min-width: 320px;
  box-sizing: border-box;
}

.dep-res-header {
  font-size: 18px;
  font-weight: bold;
  color: #0844a4;
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid #0844a4;
  padding-bottom: 6px;
}

.dep-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dep-metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 3px;
}

.dep-metric-lbl {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 4px;
}

.dep-metric-val {
  font-size: 18px;
  font-weight: bold;
  color: #0f172a;
}

.dep-metric-val.green {
  color: #166534;
}

.dep-metric-val.blue {
  color: #0284c7;
}

/* ==========================================================================
   Tab Navigation & Tables
   ========================================================================== */
.dep-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #0844a4;
  margin-bottom: 12px;
}

.dep-tab-btn {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: bold;
  color: #475569;
  cursor: pointer;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  transition: all 0.15s ease;
}

.dep-tab-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.dep-tab-btn.active {
  background: #0844a4;
  color: #ffffff;
  border-color: #0844a4;
}

.dep-table-container {
  overflow-x: auto;
  margin-top: 8px;
}

.dep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.dep-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: bold;
  text-align: right;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

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

.dep-table td {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  text-align: right;
  color: #1e293b;
}

.dep-table td:first-child {
  text-align: center;
  font-weight: bold;
}

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

.dep-table tr:hover {
  background: #f1f5f9;
}

/* ==========================================================================
   Charts & Visualizations
   ========================================================================== */
.dep-chart-card {
  background: #ffffff;
  border: 1px solid #d3d3d3;
  border-radius: 2px;
  padding: 16px;
  margin-bottom: 22px;
}

.dep-chart-title {
  font-size: 15px;
  font-weight: bold;
  color: #0844a4;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.dep-svg-chart {
  width: 100%;
  height: auto;
  display: block;
}

.dep-chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

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

.dep-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* ==========================================================================
   Fraction Arithmetic Solver (Core Requirement 1)
   ========================================================================== */
.dep-fraction-card {
  background: #ffffff;
  border: 1px solid #d3d3d3;
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 2px;
}

.dep-fraction-card h3 {
  font-size: 16px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 6px 0;
}

.dep-fraction-card p {
  font-size: 13px;
  line-height: 1.5;
  color: #555555;
  margin: 0 0 16px 0;
}

.dep-fraction-solver-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 16px;
}

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

.dep-fraction-input {
  width: 65px;
  height: 26px;
  text-align: center;
  border: 1px solid #8c9ba5;
  font-size: 14px;
  font-weight: bold;
  color: #0f172a;
  border-radius: 2px;
}

.dep-fraction-bar {
  width: 65px;
  height: 2px;
  background: #334155;
}

.dep-fraction-op {
  height: 30px;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #8c9ba5;
  border-radius: 2px;
  padding: 0 6px;
  background: #ffffff;
}

.dep-fraction-eq {
  font-size: 20px;
  font-weight: bold;
  color: #334155;
}

.dep-fraction-res {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dep-fraction-res-frac {
  font-size: 18px;
  font-weight: bold;
  color: #166534;
}

.dep-fraction-res-dec {
  font-size: 12.5px;
  color: #64748b;
  font-family: monospace;
}

.dep-visual-bar-wrap {
  margin-top: 10px;
}

.dep-visual-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
  font-weight: bold;
}

.dep-visual-bar-track {
  width: 100%;
  height: 16px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.dep-visual-bar-fill-base {
  background: #0284c7;
  transition: width 0.3s ease;
}

.dep-visual-bar-fill-salvage {
  background: #f59e0b;
  transition: width 0.3s ease;
}

/* ==========================================================================
   SEO / Educational Article
   ========================================================================== */
.dep-seo-section {
  background: #ffffff;
  border: 1px solid #d3d3d3;
  padding: 22px;
  border-radius: 2px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #333333;
}

.dep-seo-section h2 {
  font-size: 20px;
  font-weight: bold;
  color: #0844a4;
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 6px;
}

.dep-seo-section h3 {
  font-size: 16px;
  font-weight: bold;
  color: #0844a4;
  margin-top: 22px;
  margin-bottom: 8px;
}

.dep-seo-section p {
  margin-bottom: 12px;
}

.dep-seo-section ul, .dep-seo-section ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.dep-seo-section li {
  margin-bottom: 8px;
}

.dep-formula-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0844a4;
  padding: 12px 16px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12.5px;
  color: #0f172a;
  line-height: 1.55;
  margin: 14px 0;
  border-radius: 2px;
}

.dep-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.dep-faq-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 12px 14px;
}

.dep-faq-card h4 {
  font-size: 13.5px;
  font-weight: bold;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.dep-faq-card p {
  font-size: 12.5px;
  line-height: 1.45;
  color: #475569;
  margin: 0;
}

/* ==========================================================================
   Sidebar & Search (Exact Clone)
   ========================================================================== */
.dep-sidebar {
  font-size: 12.5px;
}

.dep-search-form {
  position: relative;
  display: flex;
  margin-bottom: 18px;
}

.dep-search-input {
  flex: 1;
  height: 28px;
  border: 1px solid #8c9ba5;
  border-right: none;
  padding: 4px 8px;
  font-size: 12.5px;
  box-sizing: border-box;
}

.dep-search-btn {
  background: #0844a4;
  color: #ffffff;
  border: 1px solid #0844a4;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
}

.dep-search-btn:hover {
  background: #063582;
}

.dep-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  z-index: 1000;
  display: none;
}

.dep-search-item {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dep-search-item:hover {
  background: #f0f9ff;
  color: #0284c7;
}

.dep-search-cat {
  font-size: 10.5px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 3px;
}

.dep-side-card {
  background: #f0f4f8;
  border: 1px solid #c5d5e4;
  border-radius: 2px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.dep-side-card-header {
  font-size: 14px;
  font-weight: bold;
  color: #0844a4;
  margin-bottom: 10px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
}

.dep-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
}

.dep-side-card-grid a {
  color: #006699;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.dep-side-more-link {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-weight: bold;
  color: #006699;
}

.dep-side-tabs {
  font-size: 11.5px;
  color: #666;
  text-align: center;
  padding: 8px 0;
}

.dep-side-tabs a {
  color: #006699;
  text-decoration: none;
}

.dep-side-tabs a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.dep-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.dep-modal-overlay.active {
  display: flex;
}

.dep-modal-box {
  background: #ffffff;
  border-radius: 4px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: depModalFadeIn 0.2s ease;
}

@keyframes depModalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.dep-modal-header {
  background: #0844a4;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.dep-modal-body {
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.dep-modal-form-group {
  margin-bottom: 12px;
}

.dep-modal-form-group label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #334155;
}

.dep-modal-input {
  width: 100%;
  height: 28px;
  border: 1px solid #8c9ba5;
  padding: 4px 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.dep-modal-result-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 12px;
  border-radius: 3px;
  margin-top: 14px;
}

/* ==========================================================================
   Responsive Adaptations & Print
   ========================================================================== */
@media (max-width: 860px) {
  .dep-main-grid {
    grid-template-columns: 1fr;
  }
  .dep-faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .dep-calc-top-row {
    flex-direction: column;
  }
  .dep-form-box {
    min-width: 100%;
  }
  .dep-fraction-solver-row {
    justify-content: center;
  }
}

@media print {
  .site-header, .dep-top-bar, .dep-sidebar, .dep-btn-row, .dep-fraction-card, .dep-search-form, .dep-modal-overlay {
    display: none !important;
  }
  .dep-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .dep-main-grid {
    grid-template-columns: 1fr !important;
  }
  .dep-form-box, .dep-results-box, .dep-chart-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}
