/* ==========================================================================
   CodeNest - UI Components Stylesheet (Dark-First & Developer Archetype)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Buttons & Control Elements
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #444;
}

.btn-danger {
  background: var(--accent-rose-subtle);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-rose);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 0.65rem 1.35rem;
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   2. Cards & Surface Containers
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.15rem;
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  border-color: var(--border-strong);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-description {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   3. Metric Cards Grid (Dashboard)
   -------------------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.metric-icon-wrap {
  display: none;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   4. Badges, Chips & Priority Tags
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.badge-indigo { background: rgba(79, 70, 229, 0.12); color: var(--accent-primary-light); border: 1px solid rgba(79, 70, 229, 0.25); }
.badge-emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-amber { background: rgba(249, 115, 22, 0.12); color: var(--accent-amber); border: 1px solid rgba(249, 115, 22, 0.25); }
.badge-rose { background: rgba(239, 68, 68, 0.12); color: var(--accent-rose); border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-purple { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); border: 1px solid rgba(168, 85, 247, 0.25); }
.badge-cyan { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.25); }
.badge-neutral { background: var(--bg-surface-elevated); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* Priority specific */
.priority-urgent { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.priority-high { background: rgba(249, 115, 22, 0.12); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.25); }
.priority-medium { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.25); }
.priority-low { background: var(--bg-surface-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* --------------------------------------------------------------------------
   5. Form Controls & Inputs
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--bg-surface);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-textarea.code-editor {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  tab-size: 2;
}

/* --------------------------------------------------------------------------
   6. Code Snippets & Syntax Container
   -------------------------------------------------------------------------- */
.code-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.code-card-header {
  padding: 0.75rem 1rem;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.code-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.code-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.code-block-wrap {
  position: relative;
  background: #090b10;
  max-height: 320px;
  overflow: auto;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  padding: 1rem;
  color: #e2e8f0;
  white-space: pre;
  tab-size: 2;
}

.code-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.code-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   7. Discord-Inspired Group Chat Component
   -------------------------------------------------------------------------- */
.chat-container {
  display: flex;
  height: calc(100vh - var(--header-height) - 4.5rem);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Channels List */
.chat-sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-sidebar-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-list {
  list-style: none;
  padding: 0.6rem 0.5rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.channel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  transition: all var(--transition-fast);
}

.channel-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.channel-btn.active {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.channel-hash {
  color: var(--text-muted);
  font-weight: 700;
}

/* Chat Main Feed */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-surface);
}

.chat-header {
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.chat-channel-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat-channel-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-channel-topic {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border-strong);
  padding-left: 0.6rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.chat-message-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  position: relative;
  transition: background var(--transition-fast);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
}

.chat-message-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
}

.message-body {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.message-author {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.message-author.is-current {
  color: var(--accent-cyan);
}

.message-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.message-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.message-content code {
  font-family: var(--font-mono);
  background: #0d1017;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reaction-chip:hover {
  border-color: var(--accent-primary);
}

.reaction-chip.reacted {
  background: var(--accent-primary-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Chat Input Bar */
.chat-input-container {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.chat-input-form {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent-primary);
}

/* Members sidebar in chat */
.chat-members-sidebar {
  width: 190px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  padding: 0.85rem;
  overflow-y: auto;
}

.chat-members-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.chat-member-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   8. Tasks & Today's Grind
   -------------------------------------------------------------------------- */
.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.45rem;
  transition: all var(--transition-fast);
}

.task-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.task-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  background: transparent;
}

.task-checkbox.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.task-details {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.task-item.completed {
  opacity: 0.6;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.task-item:hover .task-actions {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   9. Syllabus Tracker Components
   -------------------------------------------------------------------------- */
.syllabus-subject-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
  overflow: hidden;
}

.syllabus-header {
  padding: 0.95rem 1.15rem;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-subtle);
}

.syllabus-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.subject-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  background: #0a0a0a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent-primary-light);
}

.subject-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.syllabus-units-container {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.syllabus-unit-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.unit-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.topic-item.done {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Progress bar */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #222222;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  transition: width 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   10. CodeFun Gamified Challenges Component
   -------------------------------------------------------------------------- */
.challenge-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.challenge-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.challenge-code-view {
  background: #0a0a0a;
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-primary-light);
  margin-bottom: 1rem;
  white-space: pre-wrap;
  border: 1px solid var(--border-subtle);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.option-btn {
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: left;
  transition: all var(--transition-fast);
}

.option-btn:hover:not(:disabled) {
  border-color: rgba(79, 70, 229, 0.4);
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-primary-light);
}

.option-btn.correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--accent-emerald) !important;
  color: var(--accent-emerald) !important;
}

.option-btn.wrong {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: var(--accent-rose) !important;
  color: var(--accent-rose) !important;
}

.challenge-explanation {
  background: #0a0a0a;
  border-left: 3px solid var(--accent-primary);
  padding: 0.85rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.85rem;
  display: none;
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.challenge-explanation.show {
  display: block;
  animation: fadeIn 200ms ease;
}

/* --------------------------------------------------------------------------
   11. Exam Mode / Lock-In Pomodoro Component
   -------------------------------------------------------------------------- */
.pomodoro-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin: 1rem 0;
  text-shadow: 0 0 16px rgba(79, 70, 229, 0.35);
}

.timer-mode-chips {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   12. Modals & Dialogs
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
}

/* --------------------------------------------------------------------------
   13. Command Palette (Ctrl + K)
   -------------------------------------------------------------------------- */
.palette-dialog {
  max-width: 620px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.palette-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface-elevated);
}

.palette-input {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-primary);
  outline: none;
}

.palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.palette-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.palette-item:hover, .palette-item.selected {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
}

.palette-item-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   14. Toast Notification System
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 150;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideInToast 250ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
}

.toast.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast.toast-error { border-left: 4px solid var(--accent-rose); }
.toast.toast-info { border-left: 4px solid var(--accent-cyan); }
.toast.toast-warning { border-left: 4px solid var(--accent-amber); }

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   15. Empty States
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.empty-subtitle {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 0 auto 1.25rem;
}
