/* ── Theme Switcher ─────────────────────────── */
:root {
  /* Default (Indigo) */
  --theme-primary: #6366f1;
  --theme-glow: rgba(99, 102, 241, 0.3);
  --theme-gradient-1: rgba(99, 102, 241, 0.1);
  --theme-gradient-2: rgba(139, 92, 246, 0.1);
  --theme-nav-active: rgba(99, 102, 241, 0.15);
}

[data-theme="purple"] {
  --theme-primary: #a855f7;
  --theme-glow: rgba(168, 85, 247, 0.3);
  --theme-gradient-1: rgba(168, 85, 247, 0.1);
  --theme-gradient-2: rgba(192, 132, 252, 0.1);
  --theme-nav-active: rgba(168, 85, 247, 0.15);
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.3);
}

[data-theme="emerald"] {
  --theme-primary: #10b981;
  --theme-glow: rgba(16, 185, 129, 0.3);
  --theme-gradient-1: rgba(16, 185, 129, 0.1);
  --theme-gradient-2: rgba(52, 211, 153, 0.1);
  --theme-nav-active: rgba(16, 185, 129, 0.15);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.3);
}

[data-theme="sunset"] {
  --theme-primary: #f59e0b;
  --theme-glow: rgba(245, 158, 11, 0.3);
  --theme-gradient-1: rgba(245, 158, 11, 0.1);
  --theme-gradient-2: rgba(249, 115, 22, 0.1);
  --theme-nav-active: rgba(245, 158, 11, 0.15);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --success: #10b981;
}

[data-theme="ocean"] {
  --theme-primary: #06b6d4;
  --theme-glow: rgba(6, 182, 212, 0.3);
  --theme-gradient-1: rgba(6, 182, 212, 0.1);
  --theme-gradient-2: rgba(14, 165, 233, 0.1);
  --theme-nav-active: rgba(6, 182, 212, 0.15);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.3);
}

/* Update bg gradients for themes */
[data-theme] body {
  background-image:
    radial-gradient(circle at 0% 0%, var(--theme-gradient-1) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, var(--theme-gradient-2) 0%, transparent 40%);
}

/* ── Search Modal ───────────────────────────── */
#searchModal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: none;
  justify-content: center;
  padding-top: 15vh;
  backdrop-filter: blur(4px);
}
#searchModal.open { display: flex; }
#searchBox {
  width: 90%; max-width: 600px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}
#searchInput {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  outline: none;
  border-bottom: 1px solid var(--border-color);
}
#searchInput::placeholder { color: var(--text-muted); }
#searchResults {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--surface-hover); }
.search-result-icon { font-size: 24px; flex-shrink: 0; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-section {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--theme-nav-active);
  color: var(--theme-primary);
  flex-shrink: 0;
}
#searchEmpty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Theme Switcher UI ──────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.theme-card {
  padding: 16px 8px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.theme-card:hover { border-color: var(--text-muted); }
.theme-card.active { border-color: var(--accent); }
.theme-card-color {
  width: 32px; height: 32px;
  border-radius: 50%;
  margin: 0 auto 8px;
}
.theme-card-name {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.theme-card.active .theme-card-name { color: #fff; }

/* ── Toast for Notifications ──────────────────── */
.notif-permission-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  margin: 12px 0;
}
.notif-permission-bar .status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.notif-permission-bar .status-text { font-size: 13px; color: var(--text-muted); flex: 1; }
