/* ============================================
   Interactive Tools — Shared Styles
   ============================================ */

/* ---- TOOL LAYOUT ---- */
.tool-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  align-items: start;
}

.tool-inputs { display: flex; flex-direction: column; gap: 24px; }

.tool-field { display: flex; flex-direction: column; gap: 10px; }

.tool-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
}

.tool-time-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: white;
  width: 100%;
  max-width: 200px;
}
.tool-time-input:focus {
  outline: none;
  border-color: var(--sage);
}

.tool-textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  width: 100%;
  min-height: 80px;
  resize: vertical;
}
.tool-textarea:focus { outline: none; border-color: var(--sage); }

/* ---- OPTION BUTTONS ---- */
.tool-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-option {
  padding: 8px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: inherit;
  transition: all 0.15s;
}
.tool-option:hover { border-color: var(--sage); color: var(--sage); }
.tool-option.selected {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

.btn-calculate {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 16px;
  margin-top: 8px;
}

/* ---- RESULTS PANEL ---- */
.tool-results {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 400px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
  padding: 32px;
}
.results-placeholder-icon { font-size: 48px; opacity: 0.3; }

/* Results content */
.results-header {
  background: var(--sage);
  color: white;
  padding: 24px 28px;
}
.results-header h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  margin-bottom: 6px;
}
.results-header p { font-size: 14px; opacity: 0.85; }

.results-body { padding: 24px 28px; }

.result-window-display {
  text-align: center;
  padding: 24px;
  background: var(--sage-light);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.result-window-ratio {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 56px;
  color: var(--sage-dark);
  line-height: 1;
  margin-bottom: 6px;
}
.result-window-name { font-size: 16px; color: var(--sage); font-weight: 500; }

.result-schedule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.result-time-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.result-time-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
.result-time-value { font-size: 20px; font-weight: 500; color: var(--charcoal); }

.result-tips h4 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
  margin-bottom: 10px;
}
.result-tips ul { list-style: none; }
.result-tips li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 5px 0 5px 16px;
  position: relative;
  border-bottom: 1px dashed var(--border);
}
.result-tips li:last-child { border-bottom: none; }
.result-tips li::before { content: '→'; position: absolute; left: 0; color: var(--sage); }

.result-warning {
  background: var(--amber-light);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  margin-top: 16px;
}
.result-danger {
  background: var(--red-light);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  margin-top: 16px;
}

/* ---- SYMPTOM CHIPS ---- */
.symptom-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.symptom-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
  user-select: none;
}
.symptom-chip:hover { border-color: var(--sage); color: var(--sage); }
.symptom-chip input[type="checkbox"] { display: none; }
.symptom-chip:has(input:checked) {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

/* ---- CHECKER RESULTS ---- */
.checker-context { margin-bottom: 8px; }
.checker-results {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checker-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.checker-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.checker-card-icon { font-size: 22px; flex-shrink: 0; }
.checker-card-title { font-weight: 500; color: var(--charcoal); font-size: 16px; }
.checker-card-severity {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 10px;
}
.sev-normal { background: var(--sage-light); color: var(--sage-dark); }
.sev-watch { background: var(--amber-light); color: var(--amber); }
.sev-act { background: var(--red-light); color: var(--red); }
.sev-good { background: #e8f5e9; color: #2e7d32; }

.checker-card-body { padding: 16px 20px; }
.checker-card-body p { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.6; }
.checker-card-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 8px;
}
.checker-card-action strong { color: var(--sage); }

.checker-emergency {
  background: var(--red-light);
  border: 2px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
}
.checker-emergency h3 { color: var(--red); font-size: 18px; margin-bottom: 8px; }
.checker-emergency p { color: var(--text); font-size: 14px; }

/* ---- PROGRESS TRACKER ---- */
.tracker-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}
.tracker-form-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  color: var(--charcoal);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tracker-fields { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.save-confirm {
  display: inline-block;
  margin-top: 12px;
  color: var(--sage);
  font-weight: 500;
  font-size: 14px;
}

.tracker-history { }
.tracker-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.tracker-history-header h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  color: var(--charcoal);
}

.tracker-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.tracker-stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.tracker-stat-val {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 28px;
  color: var(--sage);
  line-height: 1;
  margin-bottom: 4px;
}
.tracker-stat-label { font-size: 12px; color: var(--text-muted); }

.tracker-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.tracker-entry {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.tracker-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.tracker-entry-date { font-weight: 500; color: var(--charcoal); font-size: 15px; }
.tracker-entry-window {
  background: var(--sage-light);
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 10px;
}
.tracker-entry-scores {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.tracker-entry-symptoms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tracker-symptom-tag {
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
  color: var(--text-muted);
}
.tracker-entry-notes { font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 6px; }
.tracker-entry-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}
.tracker-entry-delete:hover { background: var(--red-light); color: var(--red); }

/* ---- EXPLAINER GRID ---- */
.tool-explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tool-explainer-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.te-icon { font-size: 28px; margin-bottom: 12px; }
.tool-explainer-card h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 18px;
  color: var(--charcoal);
  margin-bottom: 10px;
}
.tool-explainer-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-explainer-grid { grid-template-columns: 1fr; }
  .result-schedule { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .tracker-form { padding: 20px; }
  .result-schedule { grid-template-columns: 1fr; }
}
