/**
 * Rekaptr Medal Clip Studio - Clip Vault (Full-Width Unified Game Hub)
 * Single-pane layout with top segmented view switcher, horizontal game pills,
 * game cover poster cards, automatic shelves, timeline buckets, focused hero banners,
 * sortable table view, and floating batch actions. (No stacked sidebars!)
 */

.vault-container-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

/* -------------------------------------------------------------
 * 1. Top Header Bar (Title & Search/Sort/Mode Toolbar)
 * ------------------------------------------------------------- */
.vault-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  gap: 16px;
  flex-wrap: wrap;
  z-index: var(--z-header);
}

.vault-title-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-main-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.vault-main-title svg {
  color: var(--accent-iris);
}

.vault-counter-text {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Header Controls Toolbar */
.vault-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Search Bar with Clear Button */
.vault-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  position: relative;
}

.vault-search-box:focus-within {
  border-color: var(--accent-iris);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 1px var(--accent-iris);
}

.vault-search-box svg.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.vault-search-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: #ffffff;
  width: 160px;
  font-family: inherit;
}

.vault-search-input::placeholder {
  color: var(--text-muted);
}

.btn-search-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.btn-search-clear:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.vault-search-box.has-query .btn-search-clear {
  display: flex;
}

/* Sort Controls Group */
.vault-sort-control-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  height: 32px;
  padding: 0 4px;
  gap: 4px;
}

.vault-sort-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.vault-select-dropdown {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.vault-select-dropdown option {
  background: var(--bg-panel);
  color: #ffffff;
  padding: 6px;
}

.vault-select-dropdown:hover {
  background: var(--bg-surface-hover);
}

.btn-sort-dir-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sort-dir-toggle:hover {
  color: #ffffff;
  background: var(--bg-surface-hover);
}

.btn-sort-dir-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.btn-sort-dir-toggle.asc svg {
  transform: rotate(180deg);
}

/* View Mode Segmented Switcher */
.vault-view-mode-group {
  display: flex;
  align-items: center;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  height: 32px;
  padding: 2px;
  gap: 2px;
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-view-mode:hover {
  color: var(--text-primary);
}

.btn-view-mode.active {
  background: var(--bg-panel);
  color: #ffffff;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}

.btn-view-mode svg {
  width: 14px;
  height: 14px;
}

/* Action Buttons */
.btn-vault-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-vault-select-toggle:hover {
  color: #ffffff;
  border-color: var(--border-default);
}

.btn-vault-select-toggle.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--accent-iris);
  color: #c4b5fd;
}

.btn-vault-import {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--accent-iris);
  border: 1px solid var(--accent-iris);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-vault-import:hover {
  background: var(--accent-iris-hover);
  border-color: var(--accent-iris-hover);
  transform: translateY(-1px);
}

/* -------------------------------------------------------------
 * 2. Secondary Navigation Subfilter Bar (Segmented Tabs & Game Chips)
 * ------------------------------------------------------------- */
.vault-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  gap: 16px;
  overflow-x: auto;
}

.vault-subnav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Segmented Collection Tabs */
.vault-collection-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 2px;
  gap: 2px;
}

.vault-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.vault-tab-btn:hover {
  color: #ffffff;
  background: var(--bg-surface-hover);
}

.vault-tab-btn.active {
  background: var(--bg-surface-raised);
  border-color: var(--border-card);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.vault-tab-counter {
  font-family: var(--font-mono);
  font-size: 9px;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 5px;
  border-radius: 6px;
  color: var(--text-muted);
}

.vault-tab-btn.active .vault-tab-counter {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.25);
}

.vault-subnav-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

/* Game Filter Pills */
.vault-game-pills-list {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.vault-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.vault-filter-chip:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  color: #ffffff;
}

.vault-filter-chip.active {
  background: var(--bg-surface-raised);
  border-color: var(--accent-iris);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3);
}

.chip-game-icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.vault-chip-count {
  font-family: var(--font-mono);
  font-size: 9px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 6px;
  color: var(--text-muted);
}

/* Storage Bar in Subnav Right */
.vault-subnav-storage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
}

.vault-subnav-bar-track {
  width: 70px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.vault-subnav-bar-fill {
  height: 100%;
  width: 24%;
  background: linear-gradient(90deg, var(--accent-iris), #0284c7);
}

/* -------------------------------------------------------------
 * 3. Main Gallery Scroll Body & Dynamic Shelves
 * ------------------------------------------------------------- */
.vault-gallery-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 80px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Section Shelves (Game Sections / Date Timeline) */
.vault-shelf-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shelf-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.shelf-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shelf-header-icon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.shelf-header-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.shelf-header-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.btn-shelf-filter-focus {
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-shelf-filter-focus:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-iris);
  color: #ffffff;
}

/* Focused Game Hero Banner */
.vault-focused-game-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-card);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  background-size: cover;
  background-position: center;
  margin-bottom: 8px;
}

.vault-focused-game-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 12, 16, 0.94) 0%, rgba(15, 16, 22, 0.8) 100%);
}

.focused-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
}

.focused-hero-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.focused-hero-text h2 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.focused-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.focused-hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-hero-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-hero-action:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-iris);
  color: #fff;
}

/* -------------------------------------------------------------
 * 4. Individual Clip Cards & Grid View
 * ------------------------------------------------------------- */
.vault-clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.vault-container-view.view-compact .vault-clips-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.clip-card-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
  position: relative;
}

.clip-card-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.clip-card-item.selected {
  border-color: var(--accent-iris);
  box-shadow: 0 0 0 1px var(--accent-iris), 0 8px 24px rgba(124, 58, 237, 0.2);
}

/* Thumbnail Stage */
.clip-card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
  background-color: #0b0d14;
  overflow: hidden;
}

.clip-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 260ms ease, opacity 200ms ease;
}

.clip-card-item:hover .clip-card-thumb-img {
  transform: scale(1.04);
  opacity: 1;
}

.clip-card-scrub-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 6;
  opacity: 0;
  transition: opacity 140ms ease;
}

.clip-card-item:hover .clip-card-scrub-bar {
  opacity: 1;
}

.clip-card-scrub-progress {
  height: 100%;
  background: var(--accent-iris);
  width: 0%;
  transition: width 50ms linear;
}

.clip-card-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 12;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(11, 12, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vault-container-view.mode-multiselect .clip-card-select-checkbox,
.clip-card-item:hover .clip-card-select-checkbox,
.clip-card-item.selected .clip-card-select-checkbox {
  display: flex;
}

.clip-card-item.selected .clip-card-select-checkbox {
  background: var(--accent-iris);
  border-color: var(--accent-iris);
}

.clip-card-select-checkbox svg {
  width: 12px;
  height: 12px;
  color: #fff;
  display: none;
}

.clip-card-item.selected .clip-card-select-checkbox svg {
  display: block;
}

.clip-card-top-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
  transition: transform var(--transition-fast);
}

.vault-container-view.mode-multiselect .clip-card-top-badges {
  left: 32px;
}

.clip-badge-game {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(11, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.clip-badge-game img {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.clip-badge-event-pill {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
}

.badge-kill { background: #e11d48; }
.badge-headshot { background: #d97706; }
.badge-clutch { background: #7c3aed; }
.badge-funny { background: #0284c7; }
.badge-montage { background: #059669; }

.clip-card-bottom-badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}

.clip-card-format-tag {
  background: rgba(4, 5, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
}

.clip-card-duration-badge {
  background: rgba(4, 5, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
}

.clip-pov-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(2, 132, 199, 0.6);
  color: #7dd3fc;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

/* Cloud Storage & Backup Indicator Badges */
.clip-storage-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  user-select: none;
}

.clip-storage-badge.cloud {
  background: rgba(14, 116, 144, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.clip-storage-badge.cloud svg {
  color: #38bdf8;
}

.clip-storage-badge.local {
  background: rgba(15, 17, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.clip-storage-badge.local svg {
  color: var(--text-muted);
}

/* Table View Cloud Status Pill */
.table-cloud-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.table-cloud-status.cloud {
  background: rgba(14, 116, 144, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.table-cloud-status.cloud svg {
  color: #38bdf8;
}

.table-cloud-status.local {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.table-cloud-status.local svg {
  color: var(--text-muted);
}

.clip-card-hover-actions {
  position: absolute;
  inset: 0;
  background: rgba(11, 12, 16, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 10;
}

.clip-card-item:hover .clip-card-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.btn-card-quick-action {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-quick-play {
  background: var(--accent-iris);
  border: 1px solid var(--accent-iris);
  color: #ffffff;
}

.btn-quick-play:hover {
  background: var(--accent-iris-hover);
  transform: scale(1.04);
}

.btn-quick-share {
  background: rgba(24, 26, 38, 0.9);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-quick-share:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-iris);
}

.clip-card-details {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clip-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.clip-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-clip-favorite {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.btn-clip-favorite:hover {
  color: var(--color-gold);
  transform: scale(1.15);
}

.btn-clip-favorite.starred {
  color: var(--color-gold);
}

.btn-clip-favorite svg {
  width: 14px;
  height: 14px;
}

.clip-card-metadata-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* -------------------------------------------------------------
 * 5. List / Table View Mode
 * ------------------------------------------------------------- */
.vault-table-container {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: none;
}

.vault-container-view.view-list .vault-clips-grid,
.vault-container-view.view-list .vault-game-covers-shelf,
.vault-container-view.view-list .vault-shelf-section {
  display: none;
}

.vault-container-view.view-list .vault-table-container {
  display: block;
}

.vault-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.vault-table th {
  padding: 10px 14px;
  background: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  user-select: none;
  white-space: nowrap;
}

.vault-table th.sortable {
  cursor: pointer;
}

.vault-table th.sortable:hover {
  color: #ffffff;
}

.vault-table th.sortable.active {
  color: var(--accent-iris);
}

.vault-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.vault-table tr:last-child td {
  border-bottom: none;
}

.vault-table tr.vault-table-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.vault-table tr.vault-table-row:hover {
  background: var(--bg-surface-hover);
}

.vault-table tr.vault-table-row.selected {
  background: rgba(124, 58, 237, 0.12);
}

.table-thumb-cell {
  position: relative;
  width: 90px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.table-thumb-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-duration-pill {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.85);
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  color: #fff;
}

.table-title-cluster {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.table-clip-title {
  font-weight: 600;
  color: #ffffff;
}

.table-game-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

.table-game-tag img {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.table-format-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-table-action {
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  color: #fff;
  border-color: var(--accent-iris);
  background: var(--bg-surface-hover);
}

.btn-table-action.btn-table-play {
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(124, 58, 237, 0.35);
  color: #c4b5fd;
  font-weight: 600;
}

.btn-table-action.btn-table-play:hover {
  background: var(--accent-iris);
  border-color: var(--accent-iris);
  color: #ffffff;
}

/* -------------------------------------------------------------
 * 6. Floating Batch Action Bar
 * ------------------------------------------------------------- */
.vault-batch-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #181a26;
  border: 1px solid var(--border-active);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: var(--z-sticky);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease;
}

.vault-batch-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.batch-selection-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  padding-right: 8px;
  border-right: 1px solid var(--border-subtle);
}

.batch-count-badge {
  background: var(--accent-iris);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
}

.batch-action-btns-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-batch-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-batch-action:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-iris);
  color: #ffffff;
}

.btn-batch-action.danger {
  color: #fb7185;
}

.btn-batch-action.danger:hover {
  background: rgba(225, 29, 72, 0.2);
  border-color: var(--color-alert);
  color: #ffffff;
}

.btn-batch-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-batch-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* -------------------------------------------------------------
 * 7. Empty State View
 * ------------------------------------------------------------- */
.vault-empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.vault-empty-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.vault-empty-icon-circle svg {
  width: 26px;
  height: 26px;
}

.vault-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.vault-empty-desc {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* -------------------------------------------------------------
 * 8. Custom Folders & Custom Organization System
 * ------------------------------------------------------------- */
.btn-vault-new-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-vault-new-folder:hover {
  background: var(--accent-iris-dim);
  border-color: var(--accent-iris);
  color: #ffffff;
  box-shadow: 0 0 12px var(--accent-iris-glow);
}

/* Folders Grid View */
.vault-folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.vault-folder-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  gap: 12px;
}

.vault-folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--folder-accent, var(--accent-iris));
  opacity: 0.8;
  transition: height var(--transition-fast);
}

.vault-folder-card:hover {
  transform: translateY(-2px);
  border-color: var(--folder-accent, var(--accent-iris));
  background: var(--bg-surface-raised);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.vault-folder-card:hover::before {
  height: 4px;
}

.folder-card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.folder-emblem-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--folder-accent-dim, rgba(124, 58, 237, 0.2));
  border: 1px solid var(--folder-accent, var(--accent-iris));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.folder-card-header-info {
  flex: 1;
  min-width: 0;
}

.folder-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.folder-card-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  transition: all var(--transition-fast);
}

.folder-card-menu-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Mini thumbnail peek preview strip inside folder card */
.folder-preview-thumbnails-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-xs);
  padding: 4px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.folder-preview-thumb-item {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
  background: var(--bg-surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.folder-preview-empty-text {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 100%;
  text-align: center;
}

.folder-card-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.btn-folder-open-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-iris-hover);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-folder-open-action:hover {
  color: #ffffff;
}

.btn-folder-delete-action {
  font-size: 11px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.btn-folder-delete-action:hover {
  color: var(--color-alert);
  background: rgba(225, 29, 72, 0.15);
}

/* "+ Create New Folder" Card */
.vault-folder-card-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(18, 20, 30, 0.4);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 154px;
  text-align: center;
  gap: 8px;
}

.vault-folder-card-new:hover {
  border-color: var(--accent-iris);
  background: var(--accent-iris-dim);
  transform: translateY(-2px);
}

.vault-folder-card-new-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: bold;
}

.vault-folder-card-new:hover .vault-folder-card-new-icon {
  background: var(--accent-iris);
  color: #ffffff;
  border-color: var(--accent-iris);
}

.vault-folder-card-new-label {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.vault-folder-card-new-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Focused Folder View Hero */
.vault-focused-folder-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30, 32, 48, 0.95), rgba(18, 20, 30, 0.98));
  border: 1px solid var(--folder-accent, var(--accent-iris));
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  gap: 16px;
  flex-wrap: wrap;
}

.folder-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.folder-hero-emblem {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--folder-accent-dim, rgba(124, 58, 237, 0.25));
  border: 1.5px solid var(--folder-accent, var(--accent-iris));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.folder-hero-details h2 {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.folder-breadcrumb-trail button {
  background: transparent;
  border: none;
  color: var(--accent-iris-hover);
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
}

.folder-breadcrumb-trail button:hover {
  text-decoration: underline;
  color: #ffffff;
}

.folder-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-folder-hero-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--accent-iris);
  border: 1px solid var(--accent-iris);
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-folder-hero-add:hover {
  background: var(--accent-iris-hover);
  box-shadow: 0 0 14px var(--accent-iris-glow);
}

.btn-folder-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-folder-hero-back:hover {
  color: #ffffff;
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

/* Folder tag pill on clip card and table */
.clip-folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-folder-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Modal Dialogs for Folders */
.folder-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
}

.folder-modal-overlay.open {
  display: flex;
}

.folder-modal-window {
  background: var(--bg-panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 24px rgba(124, 58, 237, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.96) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.folder-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.folder-modal-title-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-modal-title-cluster h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.folder-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.folder-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.folder-form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.folder-input-text {
  height: 36px;
  padding: 0 12px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

.folder-input-text:focus {
  border-color: var(--accent-iris);
  box-shadow: 0 0 0 1px var(--accent-iris);
}

/* Emoji selection grid */
.folder-emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.btn-emoji-select {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-emoji-select:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: scale(1.1);
}

.btn-emoji-select.active {
  background: var(--accent-iris-dim);
  border-color: var(--accent-iris);
  box-shadow: 0 0 8px var(--accent-iris-glow);
}

/* Color swatches */
.folder-color-swatches-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-folder-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-folder-color-swatch:hover {
  transform: scale(1.15);
}

.btn-folder-color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Folder live preview */
.folder-live-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.folder-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

/* Move to Folder Selection List */
.folder-selection-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.folder-selection-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.folder-selection-item-btn:hover {
  border-color: var(--accent-iris);
  background: var(--accent-iris-dim);
}

.folder-selection-item-btn.selected {
  border-color: var(--accent-iris);
  background: var(--accent-iris-dim);
  box-shadow: 0 0 0 1px var(--accent-iris);
}

