/**
 * Utility Seva — Compound Interest Calculator Styles
 * File: css/compound-interest-calculator.css
 */

/* ==========================================================================
   1. BREADCRUMBS & PAGE WRAPPER
   ========================================================================== */
.breadcrumb-nav-compact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.breadcrumb-nav-compact a {
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-nav-compact a:hover {
  color: var(--primary-color, #2563eb);
}

.breadcrumb-nav-compact .breadcrumb-sep {
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.8rem;
  user-select: none;
  opacity: 0.7;
}

.breadcrumb-nav-compact .breadcrumb-current {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

[data-theme="dark"] .breadcrumb-nav-compact .breadcrumb-current {
  color: #f8fafc;
}

.ci-page-wrapper {
  padding: 1rem 0 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.ci-header-section {
  text-align: center;
  margin-bottom: 1.75rem;
}

.ci-page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .ci-page-title {
  color: #f8fafc;
}

.ci-page-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary, #64748b);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

[data-theme="dark"] .ci-page-subtitle {
  color: #94a3b8;
}

/* ==========================================================================
   2. TWO-COLUMN STAGE CONTAINER
   ========================================================================== */
.ci-stage-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

@media (max-width: 900px) {
  .ci-stage-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.ci-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .ci-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.25);
}

.ci-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-card-header {
  border-bottom-color: var(--border-color, #334155);
}

.ci-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

[data-theme="dark"] .ci-card-title {
  color: #f8fafc;
}

.ci-card-title svg {
  color: #10b981;
}

/* ==========================================================================
   3. MODE SELECTOR (MONTH VS YEAR)
   ========================================================================== */
.ci-mode-selector-wrapper {
  margin-bottom: 1.25rem;
}

.ci-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.4rem;
}

[data-theme="dark"] .ci-field-label {
  color: #e2e8f0;
}

.ci-field-label .optional-tag {
  font-weight: 400;
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.78rem;
  margin-left: 0.25rem;
}

.ci-mode-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-secondary, #f1f5f9);
  padding: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-mode-pills {
  background: #0f172a;
  border-color: #334155;
}

.mode-pill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  user-select: none;
}

[data-theme="dark"] .mode-pill-btn {
  color: #94a3b8;
}

.mode-pill-title {
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mode-pill-subtitle {
  font-size: 0.74rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.mode-pill-btn:hover {
  color: var(--text-primary, #0f172a);
  background: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .mode-pill-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.mode-pill-btn.active {
  background: #ffffff;
  color: #059669;
  border-color: #10b981;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .mode-pill-btn.active {
  background: #1e293b;
  color: #34d399;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Frequency Banner badge below mode pills */
.ci-freq-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 0.375rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #065f46;
}

[data-theme="dark"] .ci-freq-banner {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Hidden radio inputs for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   4. FORM INPUTS & ADORNMENTS
   ========================================================================== */
.ci-form-group {
  margin-bottom: 1.15rem;
}

.ci-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.ci-input-prefix,
.ci-input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-tertiary, #94a3b8);
  pointer-events: none;
}

.ci-input-prefix {
  left: 0.85rem;
}

.ci-input-suffix {
  right: 0.85rem;
}

.ci-input {
  width: 100%;
  padding: 0.68rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary, #0f172a);
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .ci-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.ci-input.has-prefix {
  padding-left: 2rem;
}

.ci-input.has-suffix {
  padding-right: 2rem;
}

.ci-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.ci-input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.ci-field-note {
  font-size: 0.76rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.3rem;
  line-height: 1.35;
}

[data-theme="dark"] .ci-field-note {
  color: #94a3b8;
}

.ci-error-msg {
  display: block;
  font-size: 0.76rem;
  color: #ef4444;
  margin-top: 0.25rem;
  font-weight: 500;
  min-height: 1.1rem;
}

/* Form Action Buttons */
.ci-form-actions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .ci-form-actions {
    grid-template-columns: 1fr;
  }
}

.ci-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ci-btn-primary {
  background: #10b981;
  color: #ffffff;
}

.ci-btn-primary:hover {
  background: #059669;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.ci-btn-secondary {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-color, #cbd5e1);
}

[data-theme="dark"] .ci-btn-secondary {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.ci-btn-secondary:hover {
  background: var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-btn-secondary:hover {
  background: #334155;
}

/* ==========================================================================
   5. CALCULATION RESULT PANEL
   ========================================================================== */
.ci-result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-tertiary, #94a3b8);
}

.ci-result-empty-icon {
  margin-bottom: 1rem;
  color: #cbd5e1;
}

[data-theme="dark"] .ci-result-empty-icon {
  color: #475569;
}

.ci-result-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.4rem;
}

[data-theme="dark"] .ci-result-empty-title {
  color: #f8fafc;
}

.ci-result-empty-desc {
  font-size: 0.86rem;
  max-width: 320px;
  line-height: 1.45;
}

/* Active Result Content */
.ci-result-content {
  display: none;
}

/* Person Name Banner */
.ci-person-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 1rem;
}

[data-theme="dark"] .ci-person-banner {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Hero 2-Metric Grid */
.ci-hero-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 540px) {
  .ci-hero-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.ci-hero-box {
  padding: 1.1rem;
  border-radius: 0.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.ci-hero-box.box-interest {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.03));
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .ci-hero-box.box-interest {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05));
  border-color: rgba(16, 185, 129, 0.4);
}

.ci-hero-box.box-total {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.03));
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .ci-hero-box.box-total {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(99, 102, 241, 0.05));
  border-color: rgba(99, 102, 241, 0.4);
}

.ci-hero-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: block;
}

.box-interest .ci-hero-lbl {
  color: #059669;
}

[data-theme="dark"] .box-interest .ci-hero-lbl {
  color: #34d399;
}

.box-total .ci-hero-lbl {
  color: #4f46e5;
}

[data-theme="dark"] .box-total .ci-hero-lbl {
  color: #818cf8;
}

.ci-hero-val {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace, sans-serif;
  line-height: 1.2;
  word-break: break-word;
}

.box-interest .ci-hero-val {
  color: #047857;
}

[data-theme="dark"] .box-interest .ci-hero-val {
  color: #10b981;
}

.box-total .ci-hero-val {
  color: #4338ca;
}

[data-theme="dark"] .box-total .ci-hero-val {
  color: #a5b4fc;
}

/* Breakdown List */
.ci-breakdown-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
}

[data-theme="dark"] .ci-breakdown-card {
  background: #0f172a;
  border-color: #334155;
}

.ci-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-breakdown-row {
  border-bottom-color: #334155;
}

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

.ci-breakdown-lbl {
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}

[data-theme="dark"] .ci-breakdown-lbl {
  color: #94a3b8;
}

.ci-breakdown-val {
  color: var(--text-primary, #0f172a);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace, sans-serif;
}

[data-theme="dark"] .ci-breakdown-val {
  color: #f8fafc;
}

.ci-badge-mode {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  margin-left: 0.4rem;
}

.ci-badge-mode.month {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="dark"] .ci-badge-mode.month {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.ci-badge-mode.year {
  background: #e0e7ff;
  color: #3730a3;
}

[data-theme="dark"] .ci-badge-mode.year {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

/* Formula Callout */
.ci-formula-callout {
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-left: 4px solid #10b981;
  border-radius: 0.5rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 1.15rem;
  font-size: 0.82rem;
}

[data-theme="dark"] .ci-formula-callout {
  background: #1e293b;
  border-color: #334155;
  border-left-color: #10b981;
}

.ci-formula-title {
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

[data-theme="dark"] .ci-formula-title {
  color: #f8fafc;
}

.ci-formula-math {
  font-family: 'JetBrains Mono', monospace, sans-serif;
  color: var(--text-secondary, #64748b);
  word-break: break-all;
  line-height: 1.45;
}

[data-theme="dark"] .ci-formula-math {
  color: #cbd5e1;
}

/* Timestamp strip */
.ci-timestamp-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-tertiary, #94a3b8);
  margin-bottom: 1.15rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-timestamp-strip {
  border-top-color: #334155;
}

/* Result action buttons */
.ci-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .ci-result-actions {
    grid-template-columns: 1fr;
  }
}

.ci-res-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

[data-theme="dark"] .ci-res-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.ci-res-btn:hover {
  background: var(--border-color, #e2e8f0);
  border-color: #94a3b8;
}

[data-theme="dark"] .ci-res-btn:hover {
  background: #1e293b;
  border-color: #475569;
}

/* ==========================================================================
   6. CALCULATION HISTORY SECTION
   ========================================================================== */
.ci-history-section {
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.ci-hist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ci-search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.ci-search-input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  font-size: 0.88rem;
  font-family: inherit;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
  outline: none;
}

[data-theme="dark"] .ci-search-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.ci-search-input:focus {
  border-color: #10b981;
}

.ci-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary, #94a3b8);
  pointer-events: none;
}

.ci-filter-pills {
  display: flex;
  gap: 0.35rem;
}

.ci-filter-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

[data-theme="dark"] .ci-filter-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

.ci-filter-btn.active {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.ci-bulk-actions {
  display: flex;
  gap: 0.5rem;
}

.ci-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

[data-theme="dark"] .ci-bulk-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.ci-bulk-btn:hover {
  background: var(--bg-secondary, #f1f5f9);
}

[data-theme="dark"] .ci-bulk-btn:hover {
  background: #334155;
}

.ci-bulk-btn.btn-clear-danger {
  color: #dc2626;
  border-color: #fca5a5;
}

[data-theme="dark"] .ci-bulk-btn.btn-clear-danger {
  color: #f87171;
  border-color: #7f1d1d;
}

.ci-bulk-btn.btn-clear-danger:hover {
  background: #fef2f2;
}

[data-theme="dark"] .ci-bulk-btn.btn-clear-danger:hover {
  background: #450a0a;
}

/* History List & Cards */
.ci-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ci-history-item {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.75rem;
  padding: 0.95rem 1.15rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .ci-history-item {
  background: #0f172a;
  border-color: #334155;
}

.ci-history-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .ci-history-item:hover {
  border-color: #475569;
}

.ci-hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-hist-header {
  border-bottom-color: #1e293b;
}

.ci-hist-person {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.ci-hist-user-icon {
  color: #10b981;
}

.ci-hist-name {
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .ci-hist-name {
  color: #f8fafc;
}

.ci-hist-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.ci-hist-badge.badge-month {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="dark"] .ci-hist-badge.badge-month {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.ci-hist-badge.badge-year {
  background: #e0e7ff;
  color: #3730a3;
}

[data-theme="dark"] .ci-hist-badge.badge-year {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.ci-hist-datetime {
  font-size: 0.78rem;
  color: var(--text-tertiary, #94a3b8);
  display: flex;
  gap: 0.4rem;
}

.ci-hist-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 680px) {
  .ci-hist-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
}

.ci-hist-metric {
  display: flex;
  flex-direction: column;
}

.ci-metric-lbl {
  font-size: 0.72rem;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.15rem;
}

[data-theme="dark"] .ci-metric-lbl {
  color: #94a3b8;
}

.ci-metric-val {
  font-size: 0.92rem;
  font-family: 'JetBrains Mono', monospace, sans-serif;
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .ci-metric-val {
  color: #f8fafc;
}

.ci-hist-metric.highlight-interest .ci-metric-val {
  color: #059669;
  font-weight: 700;
}

[data-theme="dark"] .ci-hist-metric.highlight-interest .ci-metric-val {
  color: #34d399;
}

.ci-hist-metric.highlight-total .ci-metric-val {
  color: #4f46e5;
  font-weight: 700;
}

[data-theme="dark"] .ci-hist-metric.highlight-total .ci-metric-val {
  color: #818cf8;
}

/* History Actions inside Item */
.ci-hist-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.ci-hist-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 0.35rem;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

[data-theme="dark"] .ci-hist-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.ci-hist-btn:hover {
  background: var(--border-color, #e2e8f0);
}

[data-theme="dark"] .ci-hist-btn:hover {
  background: #334155;
}

.ci-hist-btn.btn-delete {
  color: #dc2626;
  border-color: #fca5a5;
}

[data-theme="dark"] .ci-hist-btn.btn-delete {
  color: #f87171;
  border-color: #7f1d1d;
}

.ci-hist-btn.btn-delete:hover {
  background: #fef2f2;
}

[data-theme="dark"] .ci-hist-btn.btn-delete:hover {
  background: #450a0a;
}

/* History Empty State */
.ci-history-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-tertiary, #94a3b8);
}

.history-empty-icon {
  margin-bottom: 0.75rem;
  color: #cbd5e1;
}

[data-theme="dark"] .history-empty-icon {
  color: #475569;
}

.history-empty-text {
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto;
}

/* ==========================================================================
   7. EDUCATIONAL GUIDES & FAQ
   ========================================================================== */
.ci-edu-section {
  margin-bottom: 3rem;
}

.ci-edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 820px) {
  .ci-edu-grid {
    grid-template-columns: 1fr;
  }
}

.ci-edu-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

[data-theme="dark"] .ci-edu-card {
  background: var(--bg-card, #1e293b);
  border-color: #334155;
}

.ci-edu-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

[data-theme="dark"] .ci-edu-title {
  color: #f8fafc;
}

.ci-edu-card p,
.ci-edu-card li {
  font-size: 0.9rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.6;
}

[data-theme="dark"] .ci-edu-card p,
[data-theme="dark"] .ci-edu-card li {
  color: #94a3b8;
}

.ci-edu-card ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.ci-faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ci-faq-item {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.65rem;
  padding: 1.15rem 1.25rem;
}

[data-theme="dark"] .ci-faq-item {
  background: #1e293b;
  border-color: #334155;
}

.ci-faq-q {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.4rem;
}

[data-theme="dark"] .ci-faq-q {
  color: #f8fafc;
}

.ci-faq-a {
  font-size: 0.88rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.55;
  margin: 0;
}

[data-theme="dark"] .ci-faq-a {
  color: #94a3b8;
}

/* ==========================================================================
   8. TOAST NOTIFICATION
   ========================================================================== */
.ci-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

[data-theme="dark"] .ci-toast {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #334155;
}

.ci-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   9. PRINT STYLES
   ========================================================================== */
@media print {
  .site-header,
  .footer,
  .breadcrumb-nav-compact,
  .ci-header-section,
  .ci-form-actions,
  .ci-history-section,
  .ci-edu-section,
  .ci-toast,
  .ci-result-actions,
  .ci-mode-selector-wrapper,
  .ci-card:first-child {
    display: none !important;
  }

  body,
  .main-content,
  .ci-page-wrapper,
  .ci-stage-container {
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    display: block !important;
  }

  .ci-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .ci-hero-box {
    border: 1px solid #000000 !important;
    background: none !important;
  }

  .ci-hero-val {
    color: #000000 !important;
  }
}

