/**
 * ============================================
 * BRAINDUMP V2.00 - SMART INBOX CSS
 * ============================================
 *
 * @version     1.0.0
 * @date        2026-01-05
 *
 * DESIGN REFERENCE:
 * - docs/20260105_mvp_version_2.00_BrainDump_UX_Guide.md
 *   Section 10: SCALING ARCHITECTURE (1000+ Documents)
 *
 * ============================================
 */

/* ============================================
   SMART INBOX HEADER
   ============================================ */
.smart-inbox__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--v2-surface, #FFFFF5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  border-radius: var(--v2-radius-md, 8px);
}

.smart-inbox__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.smart-inbox__icon {
  font-size: 20px;
}

.smart-inbox__title h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--v2-text-dark, #134252);
  margin: 0;
}

.smart-inbox__count {
  font-size: 13px;
  color: var(--v2-text-light, #627C7C);
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
}

.smart-inbox__stats {
  display: flex;
  gap: 12px;
}

.smart-inbox__stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--v2-text-light, #627C7C);
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
}

.smart-inbox__stat--new {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.smart-inbox__stat--action {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* ============================================
   LOAD MORE BUTTON
   ============================================ */
/* V9.0: mymind-style Load more button */
.smart-inbox__load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  margin-top: 16px;
  background: #fafafa;
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  color: #737373;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.smart-inbox__load-more:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--v3-accent, #F97316);
  color: var(--v3-accent, #F97316);
  transform: translateY(-1px);
}

.smart-inbox__load-more:active {
  transform: translateY(0);
}

.smart-inbox__load-more-icon {
  font-size: 16px;
  animation: bounce-subtle 2s ease-in-out infinite;
}

.smart-inbox__load-more-count {
  font-size: 12px;
  color: #A3A3A3;
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ============================================
   PRIORITY INDICATORS
   ============================================ */
.ss-item--priority-high {
  border-left: 3px solid #f59e0b;
}

.ss-item--priority-medium {
  border-left: 3px solid #3b82f6;
}

.ss-item--priority-low {
  border-left: 3px solid #10b981;
}

.ss-item__priority-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.ss-item__priority-badge--new {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.ss-item__priority-badge--flagged {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.ss-item__priority-badge--action {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* ============================================
   COMMAND PALETTE (Cmd+K)
   ============================================ */
/* CRITICAL FIX V3.0: Command Palette must be above everything */
.command-palette {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--v3-z-command-palette, 9000);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.command-palette.active {
  opacity: 1;
  visibility: visible;
}

.command-palette__container {
  width: 100%;
  max-width: 600px;
  background: var(--v2-surface, #FFFFF5);
  border-radius: var(--v2-radius-lg, 12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: transform 200ms ease;
}

.command-palette.active .command-palette__container {
  transform: translateY(0) scale(1);
}

.command-palette__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.command-palette__search-icon {
  font-size: 20px;
  color: var(--v2-text-light, #627C7C);
}

.command-palette__input {
  flex: 1;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--v2-text-dark, #134252);
  outline: none;
}

.command-palette__input::placeholder {
  color: var(--v2-text-light, #627C7C);
}

.command-palette__shortcut {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
  color: var(--v2-text-light, #627C7C);
}

/* Command Palette Results */
.command-palette__results {
  max-height: 400px;
  overflow-y: auto;
}

.command-palette__section {
  padding: 8px 0;
}

.command-palette__section-title {
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--v2-text-light, #627C7C);
}

.command-palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 150ms ease;
}

.command-palette__item:hover,
.command-palette__item.selected {
  background: rgba(32, 140, 141, 0.08);
}

.command-palette__item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  font-size: 16px;
}

.command-palette__item-content {
  flex: 1;
  min-width: 0;
}

.command-palette__item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--v2-text-dark, #134252);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette__item-subtitle {
  font-size: 12px;
  color: var(--v2-text-light, #627C7C);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette__item-shortcut {
  font-size: 11px;
  font-family: monospace;
  color: var(--v2-text-light, #627C7C);
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* No results */
.command-palette__empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--v2-text-light, #627C7C);
}

.command-palette__empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.command-palette__empty-text {
  font-size: 14px;
}

/* Search operators hint */
.command-palette__hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.02);
}

.command-palette__hint {
  font-size: 11px;
  color: var(--v2-text-light, #627C7C);
}

.command-palette__hint code {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 3px;
}

/* ============================================
   COLLECTIONS NAVIGATOR (Sidebar)
   ============================================ */
.v2-sidebar__collections {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.v2-sidebar__collections-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--v2-text-light, #627C7C);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 150ms ease;
}

.v2-sidebar__collections-toggle:hover {
  color: var(--v2-text-dark, #134252);
}

.v2-sidebar__collections-icon {
  font-size: 10px;
  transition: transform 200ms ease;
}

.v2-sidebar__collections-list {
  margin-top: 8px;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 250ms ease, opacity 250ms ease;
}

.v2-sidebar__collections-list.collapsed {
  max-height: 0;
  opacity: 0;
}

.v2-sidebar__collection {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--v2-radius-sm, 6px);
  cursor: pointer;
  transition: background 150ms ease;
}

.v2-sidebar__collection:hover {
  background: rgba(0, 0, 0, 0.04);
}

.v2-sidebar__collection.active {
  background: rgba(32, 140, 141, 0.1);
}

.v2-sidebar__collection-icon {
  font-size: 14px;
}

.v2-sidebar__collection-name {
  flex: 1;
  font-size: 13px;
  color: var(--v2-text-dark, #134252);
}

.v2-sidebar__collection-count {
  font-size: 11px;
  color: var(--v2-text-light, #627C7C);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 10px;
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="warm-vault"] .smart-inbox__header {
  background: var(--surface-secondary, #1a1a1a);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="warm-vault"] .smart-inbox__title h2 {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="warm-vault"] .smart-inbox__count {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="warm-vault"] .smart-inbox__load-more {
  background: var(--surface-secondary, #1a1a1a);
  border-color: rgba(32, 140, 141, 0.4);
}

[data-theme="warm-vault"] .smart-inbox__load-more:hover {
  background: rgba(32, 140, 141, 0.1);
}

[data-theme="warm-vault"] .command-palette__container {
  background: var(--surface-primary, #0d0d0d);
}

[data-theme="warm-vault"] .command-palette__input {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="warm-vault"] .command-palette__item:hover,
[data-theme="warm-vault"] .command-palette__item.selected {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="warm-vault"] .command-palette__item-title {
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .smart-inbox__header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .command-palette {
    padding-top: 10vh;
  }

  .command-palette__container {
    max-width: calc(100% - 32px);
    margin: 0 16px;
  }

  .command-palette__hints {
    display: none;
  }
}
