/* Theme overrides applied via <html data-theme="..."> */

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-base: #0f1115;
  --bg-elevated: #171a21;
  --bg-subtle: #20242e;
  --border-subtle: #272c38;
  --border-strong: #3a4152;
  --text-primary: #f3f4f6;
  --text-secondary: #b4bccb;
  --text-muted: #8b94a7;
  --accent-primary: #f3f4f6;
  --accent-primary-hover: #d8dce6;
  --accent-soft: rgba(243, 244, 246, 0.12);
  --status-success: #22c55e;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #38bdf8;
}

:root[data-theme="oled"] {
  color-scheme: dark;
  --bg-base: #000000;
  --bg-elevated: #0a0a0c;
  --bg-subtle: #141418;
  --border-subtle: #1f1f25;
  --border-strong: #32323c;
  --text-primary: #ffffff;
  --text-secondary: #b3b3bd;
  --text-muted: #7a7a86;
  --accent-primary: #ffffff;
  --accent-primary-hover: #e4e4e7;
  --accent-soft: rgba(255, 255, 255, 0.12);
  --status-success: #22c55e;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #38bdf8;
}

:root[data-theme="paper"] {
  color-scheme: light;
  --bg-base: #f7f3eb;
  --bg-elevated: #efe9dd;
  --bg-subtle: #e6dfd0;
  --border-subtle: #dcd3c3;
  --border-strong: #c6b9a3;
  --text-primary: #2c251d;
  --text-secondary: #5a4e40;
  --text-muted: #7a6d5d;
  --accent-primary: #9a3412;
  --accent-primary-hover: #7c2d12;
  --accent-soft: rgba(154, 52, 18, 0.12);
  --status-success: #15803d;
  --status-warning: #b45309;
  --status-danger: #b91c1c;
  --status-info: #0369a1;
}

:root[data-theme="midnight"] {
  color-scheme: dark;
  --bg-base: #0b0d14;
  --bg-elevated: #141824;
  --bg-subtle: #1c2233;
  --border-subtle: #252c42;
  --border-strong: #394364;
  --text-primary: #eef2ff;
  --text-secondary: #aeb8d6;
  --text-muted: #7f8bb0;
  --accent-primary: #818cf8;
  --accent-primary-hover: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --status-success: #34d399;
  --status-warning: #fbbf24;
  --status-danger: #f87171;
  --status-info: #60a5fa;
}

/* Dark theme adjustments for subtle badges and tinted note cards */
:root[data-theme="dark"] .tab-count,
:root[data-theme="oled"] .tab-count,
:root[data-theme="midnight"] .tab-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

:root[data-theme="dark"] .view-tab.is-active .tab-count,
:root[data-theme="oled"] .view-tab.is-active .tab-count,
:root[data-theme="midnight"] .view-tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

:root[data-theme="dark"] .note-link-badge,
:root[data-theme="oled"] .note-link-badge,
:root[data-theme="midnight"] .note-link-badge {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .note-tint-amber,
:root[data-theme="oled"] .note-tint-amber,
:root[data-theme="midnight"] .note-tint-amber {
  background: #272015;
  border-color: #4a3a1d;
}

:root[data-theme="dark"] .note-tint-blue,
:root[data-theme="oled"] .note-tint-blue,
:root[data-theme="midnight"] .note-tint-blue {
  background: #141f30;
  border-color: #253b5c;
}

:root[data-theme="dark"] .note-tint-green,
:root[data-theme="oled"] .note-tint-green,
:root[data-theme="midnight"] .note-tint-green {
  background: #13251d;
  border-color: #234736;
}

:root[data-theme="dark"] .note-tint-purple,
:root[data-theme="oled"] .note-tint-purple,
:root[data-theme="midnight"] .note-tint-purple {
  background: #1e1930;
  border-color: #3a305c;
}

:root[data-theme="dark"] .note-tint-rose,
:root[data-theme="oled"] .note-tint-rose,
:root[data-theme="midnight"] .note-tint-rose {
  background: #2b181f;
  border-color: #522938;
}

:root[data-theme="dark"] .btn-primary,
:root[data-theme="oled"] .btn-primary,
:root[data-theme="midnight"] .btn-primary {
  color: #0b0d14;
}

:root[data-theme="dark"] .profile-avatar,
:root[data-theme="oled"] .profile-avatar,
:root[data-theme="midnight"] .profile-avatar,
:root[data-theme="dark"] .profile-level-badge,
:root[data-theme="oled"] .profile-level-badge,
:root[data-theme="midnight"] .profile-level-badge,
:root[data-theme="dark"] .user-avatar,
:root[data-theme="oled"] .user-avatar,
:root[data-theme="midnight"] .user-avatar {
  color: #0b0d14;
}

/* Dark OLED 3D depth & tactile surface highlights */
:root[data-theme="oled"] .panel,
:root[data-theme="oled"] .metric-card,
:root[data-theme="oled"] .profile-card,
:root[data-theme="oled"] .note-card,
:root[data-theme="oled"] .sin-card,
:root[data-theme="oled"] .goal-card,
:root[data-theme="oled"] .task-card,
:root[data-theme="oled"] .task-modal {
  background: linear-gradient(180deg, #101015 0%, #070709 100%);
  border-color: #262630;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 8px 20px rgba(0, 0, 0, 0.85),
    0 2px 4px rgba(0, 0, 0, 0.7);
}

:root[data-theme="oled"] .focus-item,
:root[data-theme="oled"] .dash-goal-row,
:root[data-theme="oled"] .dash-note-row,
:root[data-theme="oled"] .dash-fin-strip,
:root[data-theme="oled"] .wl-row,
:root[data-theme="oled"] .settings-theme-card {
  background: linear-gradient(180deg, #15151c 0%, #0d0d12 100%);
  border-color: #262630;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 3px 8px rgba(0, 0, 0, 0.65);
}

:root[data-theme="oled"] .btn,
:root[data-theme="oled"] .icon-btn,
:root[data-theme="oled"] .sin-icon-btn,
:root[data-theme="oled"] .task-action-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.75);
}

:root[data-theme="oled"] .btn-primary {
  background: linear-gradient(180deg, #ffffff 0%, #d9d9e0 100%);
  border-color: #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 4px 12px rgba(255, 255, 255, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.8);
}

:root[data-theme="oled"] .btn:active,
:root[data-theme="oled"] .icon-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.85);
}

:root[data-theme="oled"] .sidebar {
  background: linear-gradient(180deg, #09090c 0%, #000000 100%);
  border-right-color: #1f1f27;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.85);
}

:root[data-theme="oled"] .settings-modal-pane .panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}
