/**
 * WebEasier — Business Days Calculator: shared styles
 * Used by the main calculator (index.html) and every generated
 * programmatic page (see generate-pages.js). Kept as one file so
 * neither the HTML generator nor the hand-authored main page ever
 * has to duplicate this CSS.
 */
[data-theme="dark"] {
  --color-bg:        #0f172a;
  --color-bg-soft:   #1e293b;
  --color-bg-alt:    #1e293b;
  --color-border:    #334155;
  --color-text-main: #f1f5f9;
  --color-text-body: #94a3b8;
  --color-text-muted:#64748b;
  --dm-card:         #1e293b;
  --dm-input-bg:     #0f172a;
}
[data-theme="dark"] body { background: var(--color-bg); color: var(--color-text-body); }
[data-theme="dark"] #mainNavbar { background: rgba(15,23,42,.96); border-bottom-color: #334155; }
[data-theme="dark"] .tool-hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
[data-theme="dark"] .ts-card, [data-theme="dark"] .content-card { background: var(--dm-card); border-color: #334155; }
[data-theme="dark"] .ts-input { background: var(--dm-input-bg) !important; border-color: #334155 !important; color: var(--color-text-main) !important; }
[data-theme="dark"] .site-footer { background: #020617; }
[data-theme="dark"] .faq-button { background: var(--dm-card) !important; color: var(--color-text-main) !important; }
[data-theme="dark"] .faq-button:not(.collapsed) { background: rgba(37,99,235,.12) !important; }
[data-theme="dark"] .faq-body { background: var(--dm-card); color: var(--color-text-body); }
[data-theme="dark"] .dir-col { background: var(--dm-card); border-color: #334155; }
[data-theme="dark"] .dir-col a { color: #93c5fd; }
[data-theme="dark"] .dir-col a:hover { color: #fff; }
[data-theme="dark"] .dark-toggle { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .content-section { border-top-color: #1e293b; }
[data-theme="dark"] .content-section:nth-child(even) { background: #1e293b; }
[data-theme="dark"] .mode-tab { background: #1e293b; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .mode-tab.active { background: rgba(37,99,235,.2); color: #93c5fd; }

.tool-hero {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f2ff 40%, #f5f8ff 100%);
  padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden;
}
.tool-hero::before {
  content: ""; position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,.07) 0%, transparent 70%);
  top: -200px; right: -150px; pointer-events: none;
}
.dark-toggle {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 600;
  color: var(--color-text-body); background: var(--color-bg-soft); border: 1px solid var(--color-border);
  border-radius: 99px; padding: .3rem .85rem; cursor: pointer; transition: all .2s ease; line-height: 1;
}
.dark-toggle:hover { border-color: var(--color-primary); color: var(--color-primary); }

.ts-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
  box-shadow: 0 8px 40px rgba(37,99,235,.1), 0 2px 8px rgba(0,0,0,.04); padding: 2rem;
}
.ts-card h2 { font-size: 1rem; font-weight: 700; color: var(--color-text-main); margin-bottom: .25rem; }

.mode-tabs { display: inline-flex; border: 1.5px solid #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: 1.5rem; width: 100%; }
.mode-tab {
  flex: 1; font-size: .8125rem; font-weight: 700; color: #64748b; background: #fff; border: none;
  padding: .7rem .9rem; cursor: pointer; transition: all .15s; border-right: 1.5px solid #e2e8f0;
}
.mode-tab:last-child { border-right: none; }
.mode-tab.active { background: #eff6ff; color: #2563eb; }

.date-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: flex-end; }
.date-field { flex: 1; min-width: 160px; }
.date-field label { font-size: .75rem; font-weight: 600; color: #64748b; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .4rem; display: block; }
.ts-input {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: .65rem .9rem; font-size: 1rem; font-weight: 600; color: #0f172a; background: #fff;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.ts-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.result-headline {
  text-align: center; padding: 1.5rem; margin-bottom: .5rem;
  background: #eff6ff; border: 1.5px solid #bfdbfe; border-radius: 16px;
}
.result-headline .value { font-size: clamp(1.25rem, 4.2vw, 1.9rem); font-weight: 800; color: #0f172a; }
.result-headline .sub { font-size: .875rem; color: #2563eb; font-weight: 600; margin-top: .4rem; }
[data-theme="dark"] .result-headline { background: rgba(37,99,235,.1); border-color: rgba(37,99,235,.3); }
[data-theme="dark"] .result-headline .value { color: var(--color-text-main); }

.settings-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.settings-field { flex: 1; min-width: 180px; }
.settings-field label { font-size: .75rem; font-weight: 600; color: #64748b; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .4rem; display: block; }
.ts-select {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: .65rem .9rem; font-size: .875rem; font-weight: 600; color: #0f172a; background: #fff;
  outline: none; transition: border-color .18s, box-shadow .18s; cursor: pointer;
}
.ts-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
[data-theme="dark"] .ts-select { background: var(--dm-input-bg) !important; border-color: #334155 !important; color: var(--color-text-main) !important; }

.check-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: -.5rem 0 1.25rem; font-size: .8125rem; color: #475569; }
.check-row label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
[data-theme="dark"] .check-row { color: var(--color-text-body); }

.preset-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.preset-btn {
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: .4rem .9rem;
  font-size: .8125rem; font-weight: 700; color: #475569; cursor: pointer; transition: all .15s;
}
.preset-btn:hover { border-color: #2563eb; color: #2563eb; }
.preset-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-theme="dark"] .preset-btn { background: var(--dm-input-bg); border-color: #334155; color: var(--color-text-body); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin-top: .75rem; }
.stat-tile { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: .7rem .8rem; text-align: center; }
.stat-tile .stat-label { font-size: .65rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: .3rem; }
.stat-tile .stat-value { font-size: .9375rem; font-weight: 700; color: #0f172a; }
[data-theme="dark"] .stat-tile { background: var(--dm-input-bg); border-color: #334155; }
[data-theme="dark"] .stat-tile .stat-value { color: var(--color-text-main); }

.range-results { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .5rem; }
@media (max-width: 575.98px) { .range-results { grid-template-columns: 1fr; } }

.action-row { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; justify-content: center; }
.btn-action {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 700;
  padding: .5rem 1rem; border-radius: 9px; border: 1.5px solid #e2e8f0; background: #fff;
  color: #475569; cursor: pointer; transition: all .18s;
}
.btn-action:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.btn-action.copied { border-color: #22c55e; color: #16a34a; background: #f0fdf4; }
[data-theme="dark"] .btn-action { background: var(--dm-input-bg); border-color: #334155; color: var(--color-text-body); }

.field-error { display: none; font-size: .8125rem; color: #dc2626; margin: .5rem 0 0; text-align: center; }
.calendar-note { font-size: .75rem; color: #94a3b8; margin: .75rem 0 0; text-align: center; }

.content-section { padding: 4.5rem 0; border-top: 1.5px solid #dde6f0; position: relative; }
.content-section:nth-child(even) { background: #eef2f8; }
.content-section:nth-child(odd)  { background: var(--color-bg); }
.content-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 2rem; box-shadow: 0 2px 12px rgba(37,99,235,.06); height: 100%; }
.content-card h3 { font-size: 1.0625rem; font-weight: 700; color: var(--color-text-main); margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.content-card h3 .bi { color: #2563eb; }
.content-card p, .content-card li { font-size: .9rem; color: var(--color-text-body); line-height: 1.8; }

/* Same visual treatment as .content-card, but WITHOUT height:100% — used for
   several cards stacked vertically in one column (e.g. the programmatic pages'
   explainer sections). height:100% is safe for .content-card's original use
   (single card, or side-by-side grid columns) but creates a circular auto-height
   layout bug in Chromium when multiple 100%-height blocks are stacked inside a
   Bootstrap .row (a flex container) — each card ends up stretched to a huge,
   wrong height and overflows past its section. */
.explainer-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 2rem; box-shadow: 0 2px 12px rgba(37,99,235,.06); }
.explainer-card h3 { font-size: 1.0625rem; font-weight: 700; color: var(--color-text-main); margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.explainer-card h3 .bi { color: #2563eb; }
.explainer-card p, .explainer-card li { font-size: .9rem; color: var(--color-text-body); line-height: 1.8; }
[data-theme="dark"] .explainer-card { background: var(--dm-card); border-color: #334155; }

.dir-section { padding: 4.5rem 0; background: var(--color-bg-soft); }
.dir-col { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 1.5rem; height: 100%; }
.dir-col h4 { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; padding-bottom: .6rem; border-bottom: 1px solid #e2e8f0; margin-bottom: 1rem; display: flex; align-items: center; gap: .4rem; }
.dir-col h4 .bi { color: #2563eb; font-size: .9rem; }
.dir-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.dir-col ul li a { font-size: .8125rem; font-weight: 500; color: #2563eb; text-decoration: none; transition: color .16s; display: flex; align-items: center; gap: .35rem; }
.dir-col ul li a:hover { color: #1d4ed8; text-decoration: underline; }
.dir-col ul li a .bi { font-size: .75rem; opacity: .6; }

.faq-section.content-section { background: var(--color-bg) !important; border-top-color: #dde6f0; }
[data-theme="dark"] .faq-section.content-section { background: var(--color-bg) !important; border-top-color: #1e293b; }

@media (max-width: 767.98px) {
  .ts-card { padding: 1.25rem; }
  .dark-toggle { font-size: .75rem; padding: .25rem .65rem; }
  .content-section { padding: 3rem 0; }
  .dir-section { padding: 3rem 0; }
}
