/* Tools Pages — shared styles for calculators and financial tools */

:root {
  --primary-color: #1565C0;
  --light-bg: #f9f9f9;
  --border-light: #ddd;
  --border-subtle: #eee;
  --text-dark: #333;
  --text-muted: #666;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ── HEADER ───────────────────────────────────────────── */

.header {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 30px;
  padding: 15px 0;
}

.header nav {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.header .brand {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.header .brand:hover {
  text-decoration: underline;
}

.header .spacer {
  flex: 1;
}

.header select,
.header button {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: var(--text-dark);
}

.header button {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  font-weight: 500;
  transition: background 0.3s;
}

.header button:hover {
  background: #1043a0;
}

/* ── BREADCRUMB ───────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text-muted);
}

/* ── TOOL CONTAINER ───────────────────────────────────── */

.tool-container {
  width: 100%;
}

.tool-header {
  margin-bottom: 30px;
}

.tool-header h1 {
  font-size: 2em;
  margin: 0 0 10px 0;
  color: var(--text-dark);
}

.tool-header p {
  font-size: 1.1em;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── TOOL CARD ───────────────────────────────────────── */

.tool-card {
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── FORMS & INPUTS ───────────────────────────────────── */

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
  font-family: inherit;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.input-group input[type="number"] {
  text-align: right;
}

.input-group input[type="time"] {
  text-align: center;
}

/* ── MODE BUTTONS ───────────────────────────────────────– */

.mode-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mode-buttons button {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border: 2px solid var(--border-light);
  background: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  font-size: 14px;
  color: var(--text-dark);
}

.mode-buttons button:hover {
  border-color: var(--primary-color);
  background: #f0f0f0;
}

.mode-buttons button.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* ── RESULTS ──────────────────────────────────────────– */

.calc-result {
  background: var(--light-bg);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border-left: 4px solid var(--primary-color);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
}

.result-row:last-child {
  border-bottom: none;
}

.result-row.highlight {
  background: #e3f2fd;
  padding: 15px;
  margin: 10px -5px;
  border-radius: 6px;
  border-bottom: none;
  font-weight: 600;
}

.result-label {
  font-weight: 600;
  color: var(--text-muted);
}

.result-value {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1em;
  text-align: right;
}

/* ── COMPARISON TABLE ──────────────────────────────────– */

.comparison-table {
  margin-top: 15px;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-light);
  font-size: 14px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid var(--border-light);
}

.comparison-table th {
  background: #f5f5f5;
  font-weight: 600;
  color: var(--text-dark);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.comparison-table tr.highlight-row {
  background: #fff3cd;
  font-weight: 600;
}

/* ── INFO BOXES ───────────────────────────────────────– */

.rate-info {
  background: #e8f4f8;
  padding: 15px;
  border-radius: 6px;
  margin: 15px 0;
  border-left: 4px solid #0288d1;
}

.rate-info p {
  margin: 5px 0;
  font-size: 14px;
  color: var(--text-dark);
}

.rate-info p:first-child {
  font-weight: 600;
  margin-bottom: 10px;
}

.info-box {
  background: #f0f7ff;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  border-left: 4px solid var(--primary-color);
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.6;
}

/* ── TOOLS CONTAINER (FAQ, SEO, Related) ───────────────– */

.tools-container {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border-subtle);
}

.tool-faq,
.tool-seo-content-section,
.related-tools {
  margin-bottom: 30px;
}

/* ── FAQ ───────────────────────────────────────────────– */

.tool-faq h2,
.tool-seo-content-section h2,
.related-tools h2 {
  font-size: 1.5em;
  margin: 20px 0 15px 0;
  color: var(--text-dark);
}

.faq-item {
  margin-bottom: 15px;
  padding: 15px;
  background: var(--light-bg);
  border-radius: 6px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-dark);
  padding: 5px 0;
  user-select: none;
}

.faq-item summary:hover {
  color: var(--primary-color);
}

.faq-item details[open] summary {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.faq-item p {
  margin: 10px 0 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ── SEO CONTENT ───────────────────────────────────────– */

.tool-seo-content-section p {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: justify;
}

.tool-seo-content-section h3 {
  margin: 20px 0 10px 0;
  font-size: 1.2em;
  color: var(--text-dark);
}

.tool-seo-content-section ul,
.tool-seo-content-section ol {
  margin: 10px 0 10px 20px;
  padding: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

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

/* ── RELATED TOOLS ─────────────────────────────────────– */

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.related-tool-card {
  background: var(--light-bg);
  padding: 15px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.3s;
  border: 1px solid var(--border-light);
}

.related-tool-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.15);
  transform: translateY(-2px);
}

.related-tool-card .icon {
  font-size: 2em;
  margin-bottom: 10px;
}

.related-tool-card .title {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-color);
}

.related-tool-card .desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ── FOOTER ───────────────────────────────────────────– */

footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.tools-footer {
  background: #212121;
  border-top: 1px solid rgba(0,0,0,.2);
  padding: 24px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: #9E9E9E;
  margin-top: 40px;
}

.tools-footer a {
  color: #BDBDBD;
}

.tools-footer a:hover {
  color: #fff;
}

/* ── RESPONSIVE ───────────────────────────────────────– */

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .tool-card {
    padding: 20px;
  }

  .tool-header h1 {
    font-size: 1.5em;
  }

  .header nav {
    gap: 10px;
  }

  .mode-buttons {
    flex-direction: column;
  }

  .mode-buttons button {
    min-width: auto;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 0;
  }

  .result-value {
    text-align: left;
    margin-top: 5px;
  }

  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}

/* ── PRINT STYLES ───────────────────────────────────────– */

@media print {
  .header,
  footer,
  .mode-buttons,
  .tool-faq,
  .related-tools {
    display: none;
  }

  .tool-card {
    box-shadow: none;
    border: 1px solid var(--border-light);
  }
}
