/**
 * Manic Pixels Web OS — explorer.css
 * File Explorer: toolbar, sidebar, breadcrumb, view modes, status bar.
 * Sprint 5
 */

/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════════════════════════════════ */

.mp-explorer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--mp-window-bg-solid);
  color: var(--mp-surface-fg);
  font-family: var(--mp-font-ui);
  font-size: 13px;
  overflow: hidden;
  user-select: none;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.mp-explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--mp-window-border);
  flex-shrink: 0;
  height: 40px;
}

/* Nav buttons (back / forward / up) */
.mp-explorer-nav-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--mp-surface-fg, #e8e8f0);
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
  flex-shrink: 0;
}

.mp-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10);
}

.mp-nav-btn:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.mp-nav-btn:disabled {
  opacity: 0.30;
  cursor: default;
}

.mp-nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Breadcrumb */
.mp-explorer-breadcrumb-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--mp-window-border);
  border-radius: 6px;
  padding: 0 8px;
  height: 28px;
  overflow: hidden;
  gap: 2px;
}

.mp-bc-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  line-height: 1;
  padding: 0 1px;
  flex-shrink: 0;
}

.mp-bc-item {
  display: flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-family: inherit;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-bc-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.mp-bc-item.active {
  color: #ffffff;
  cursor: default;
  font-weight: 500;
}

.mp-bc-arrow {
  font-size: 10px;
  opacity: 0.5;
  margin-left: 1px;
  pointer-events: auto;
  cursor: pointer;
  padding: 1px 2px;
  border-radius: 3px;
}

.mp-bc-arrow:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.9;
}

.mp-bc-search-label {
  color: var(--mp-accent);
  font-size: 12px;
  font-style: italic;
}

/* Breadcrumb dropdown */
.mp-bc-dropdown {
  position: fixed;
  z-index: 9000;
  background: var(--mp-menu-bg, rgba(22, 22, 34, 0.98));
  border: 1px solid var(--mp-menu-border, rgba(255, 255, 255, 0.10));
  border-radius: var(--mp-menu-radius, 8px);
  box-shadow: var(--mp-menu-shadow, 0 4px 24px rgba(0, 0, 0, 0.40));
  min-width: 160px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  backdrop-filter: blur(12px);
  animation: mp-menu-in 0.12s ease;
}

.mp-bc-dropdown-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--mp-menu-fg, #e8e8f0);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-bc-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Search input */
.mp-explorer-search-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Prefixo .mp-explorer-search-wrap aumenta especificidade para (0,2,0)=20,
   garantindo que as propriedades visuais do input nunca sejam sobrescritas
   pela regra global input[type="search"] de controls.css (0,1,1)=11,
   independente do tema activo. */
.mp-explorer-search-wrap .mp-explorer-search {
  width: 180px;
  height: 28px;
  padding: 0 10px 0 30px !important;
  background: var(--mp-input-bg, rgba(0, 0, 0, 0.25)) !important;
  border: 1px solid var(--mp-input-border, var(--mp-window-border)) !important;
  border-radius: 6px !important;
  color: var(--mp-text-primary, var(--mp-surface-fg, #e8e8f0)) !important;
  font-family: inherit;
  font-size: 12px !important;
  outline: none;
  transition: border-color 0.15s;
  /* Remove ícone nativo do browser para não sobrepor o ::before customizado */
  appearance: none;
  -webkit-appearance: none;
}

/* Remove todos os ornamentos nativos do input[type="search"] */
.mp-explorer-search::-webkit-search-decoration,
.mp-explorer-search::-webkit-search-cancel-button,
.mp-explorer-search::-webkit-search-results-button,
.mp-explorer-search::-webkit-search-results-decoration {
  display: none;
}

.mp-explorer-search:focus {
  border-color: var(--mp-accent);
}

.mp-explorer-search::placeholder {
  color: var(--mp-text-secondary, rgba(255, 255, 255, 0.30));
}

.mp-explorer-search-wrap::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}

/* View buttons */
.mp-explorer-view-btns {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: 4px;
}

.mp-explorer-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.mp-explorer-view-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.80);
}

.mp-explorer-view-btn.active {
  background: rgba(var(--mp-accent-rgb), 0.18);
  color: var(--mp-accent);
}

.mp-explorer-view-btn svg {
  width: 15px;
  height: 15px;
}

/* ── Body (sidebar + pane) ────────────────────────────────────────────────── */

.mp-explorer-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.mp-explorer-sidebar {
  width: 200px;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  border-right: 1px solid var(--mp-window-border);
  background: rgba(255, 255, 255, 0.015);
}

.mp-explorer-sidebar::-webkit-scrollbar {
  width: 4px;
}
.mp-explorer-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* Resizer */
.mp-explorer-resizer {
  width: 4px;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  transition: background 0.15s;
}

.mp-explorer-resizer:hover,
.mp-explorer-resizer:active {
  background: rgba(var(--mp-accent-rgb), 0.35);
}

/* ── Quick Access / Sidebar items ─────────────────────────────────────────── */

.mp-qa-section-header {
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.30);
  cursor: default;
}

.mp-qa-section-wrap:first-child .mp-qa-section-header {
  padding-top: 4px;
}

.mp-qa-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.70);
  font-family: inherit;
  font-size: 12.5px;
  padding: 5px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
  overflow: hidden;
  position: relative;
}

.mp-qa-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.mp-qa-item.active {
  background: rgba(var(--mp-accent-rgb), 0.15);
  color: var(--mp-accent);
}

.mp-qa-item.small {
  font-size: 11.5px;
  padding: 4px 12px;
  color: rgba(255, 255, 255, 0.50);
}

.mp-qa-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.mp-qa-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-qa-unpin {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.60);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.mp-qa-item:hover .mp-qa-unpin {
  display: flex;
}

.mp-qa-unpin:hover {
  background: rgba(255, 95, 87, 0.35);
  color: #ff5f57;
}

/* ── Main pane ────────────────────────────────────────────────────────────── */

.mp-explorer-pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
  position: relative;
}

.mp-explorer-pane::-webkit-scrollbar {
  width: 6px;
}
.mp-explorer-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
.mp-explorer-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.mp-explorer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: rgba(255, 255, 255, 0.20);
  pointer-events: none;
}

.mp-explorer-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.mp-explorer-empty span {
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════════════════
   VIEW MODES
   ══════════════════════════════════════════════════════════════════════════ */

.mp-explorer-items {
  padding: 8px;
}

/* ── Icons mode ───────────────────────────────────────────────────────────── */

.mp-view-icons {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  padding: 12px;
}

.mp-view-icons .mp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 80px;
  padding: 8px 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}

.mp-view-icons .mp-item-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-view-icons .mp-item-emoji {
  font-size: 36px;
  line-height: 1;
}

.mp-view-icons .mp-item-name {
  font-size: 11.5px;
  text-align: center;
  line-height: 1.3;
  max-width: 76px;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Tiles mode ───────────────────────────────────────────────────────────── */

.mp-view-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  padding: 8px;
}

.mp-view-tiles .mp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  overflow: hidden;
}

.mp-view-tiles .mp-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-view-tiles .mp-item-emoji {
  font-size: 28px;
  line-height: 1;
}

.mp-view-tiles .mp-item-info {
  flex: 1;
  min-width: 0;
}

.mp-view-tiles .mp-item-name {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-view-tiles .mp-item-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}

/* ── List mode ────────────────────────────────────────────────────────────── */

.mp-view-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px;
}

.mp-view-list .mp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
  min-height: 24px;
}

.mp-view-list .mp-item-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mp-view-list .mp-item-emoji {
  font-size: 15px;
  line-height: 1;
}

.mp-view-list .mp-item-name {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Details mode ─────────────────────────────────────────────────────────── */

.mp-view-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.mp-details-header {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 28px;
  border-bottom: 1px solid var(--mp-window-border);
  position: sticky;
  top: 0;
  background: var(--mp-window-bg-solid);
  z-index: 2;
}

.mp-details-th {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  cursor: pointer;
  padding: 0 6px;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.1s;
  user-select: none;
}

.mp-details-th:first-child { flex: 2; min-width: 0; }
.mp-details-th:nth-child(2) { width: 150px; flex-shrink: 0; }
.mp-details-th:nth-child(3) { width: 100px; flex-shrink: 0; }
.mp-details-th:last-child   { width: 80px;  flex-shrink: 0; text-align: right; justify-content: flex-end; }

.mp-details-th:hover {
  color: rgba(255, 255, 255, 0.80);
}

.mp-details-th.sorted {
  color: var(--mp-accent);
}

.mp-view-details .mp-item {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.08s;
  gap: 0;
}

.mp-view-details .mp-item-icon {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
}

.mp-view-details .mp-item-emoji {
  font-size: 14px;
  line-height: 1;
}

.mp-view-details .mp-item-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
  font-size: 12.5px;
}

.mp-view-details .mp-item-name { flex: 2; min-width: 0; color: rgba(255, 255, 255, 0.85); }
.mp-view-details .mp-item-date { width: 150px; flex-shrink: 0; color: rgba(255, 255, 255, 0.45); }
.mp-view-details .mp-item-type { width: 100px; flex-shrink: 0; color: rgba(255, 255, 255, 0.45); }
.mp-view-details .mp-item-size { width: 80px;  flex-shrink: 0; color: rgba(255, 255, 255, 0.45); text-align: right; }

/* ══════════════════════════════════════════════════════════════════════════
   ITEM STATES (shared across all modes)
   ══════════════════════════════════════════════════════════════════════════ */

.mp-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mp-item.selected {
  background: rgba(var(--mp-accent-rgb), 0.18);
}

.mp-item.selected .mp-item-name {
  color: var(--mp-accent) !important;
}

.mp-item.cut {
  opacity: 0.45 !important;
  /* Desabilita a animação de entrada para que a opacidade não seja sobrescrita */
  animation: none !important;
}

.mp-item.dragging {
  opacity: 0.50;
}

.mp-item.drag-over {
  background: rgba(var(--mp-accent-rgb), 0.25);
  outline: 2px solid var(--mp-accent);
  outline-offset: -2px;
}

/* Rename in progress */
.mp-item-name[contenteditable="true"] {
  background: var(--mp-input-bg, rgba(0, 0, 0, 0.40));
  border: 1px solid var(--mp-accent);
  border-radius: 3px;
  outline: none;
  padding: 1px 4px;
  color: #ffffff !important;
  min-width: 60px;
  max-width: 160px;
  cursor: text;
  text-overflow: clip;
  white-space: nowrap;
  overflow: hidden;
  -webkit-line-clamp: unset !important;
}

/* Search highlight */
.mp-item-name mark {
  background: rgba(var(--mp-accent-rgb), 0.35);
  color: #ffffff;
  border-radius: 2px;
  padding: 0 1px;
}

/* ══════════════════════════════════════════════════════════════════════════
   STATUS BAR
   ══════════════════════════════════════════════════════════════════════════ */

.mp-explorer-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  height: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--mp-window-border);
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

.mp-explorer-status-sel {
  color: var(--mp-accent);
}

/* ══════════════════════════════════════════════════════════════════════════
   ANIMATION
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes mp-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Entrance animation for items */
.mp-explorer-items .mp-item {
  animation: mp-item-in 0.12s ease both;
}

@keyframes mp-item-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger via nth-child — first 20 items */
.mp-explorer-items .mp-item:nth-child(1)  { animation-delay: 0ms; }
.mp-explorer-items .mp-item:nth-child(2)  { animation-delay: 15ms; }
.mp-explorer-items .mp-item:nth-child(3)  { animation-delay: 25ms; }
.mp-explorer-items .mp-item:nth-child(4)  { animation-delay: 35ms; }
.mp-explorer-items .mp-item:nth-child(5)  { animation-delay: 45ms; }
.mp-explorer-items .mp-item:nth-child(6)  { animation-delay: 55ms; }
.mp-explorer-items .mp-item:nth-child(7)  { animation-delay: 65ms; }
.mp-explorer-items .mp-item:nth-child(8)  { animation-delay: 72ms; }
.mp-explorer-items .mp-item:nth-child(n+9){ animation-delay: 80ms; }

/* ══════════════════════════════════════════════════════════════════════════
   SCROLLBAR (pane)
   ══════════════════════════════════════════════════════════════════════════ */

.mp-explorer-pane {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

/* ══════════════════════════════════════════════════════════════════════════
   ESTE COMPUTADOR — drive item
   ══════════════════════════════════════════════════════════════════════════ */

.mp-drive-item {
  display:     flex;
  align-items: center;
  gap:         12px;
  width:       220px;
  padding:     12px 14px !important;
  height:      auto !important;
}

.mp-drive-item .mp-item-icon {
  width:  40px !important;
  height: 40px !important;
  flex-shrink: 0;
}

.mp-drive-item .mp-item-emoji {
  font-size: 28px !important;
}

.mp-drive-item .mp-item-info {
  flex: 1;
  min-width: 0;
}

.mp-drive-item .mp-item-name {
  font-size:   var(--mp-font-size-sm);
  font-weight: 500;
  color:       var(--mp-text-primary);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.mp-drive-bar {
  height:        4px;
  border-radius: 2px;
  background:    var(--mp-progress-track);
  overflow:      hidden;
  margin-bottom: 4px;
}

.mp-drive-bar-fill {
  height:        100%;
  border-radius: 2px;
  background:    var(--mp-accent);
  transition:    width 0.4s ease;
}

/* Vermelho quando > 90% */
.mp-drive-bar-fill[style*="9"] {
  background: #da4453;
}

.mp-drive-meta {
  font-size:  var(--mp-font-size-xs);
  color:      var(--mp-text-secondary);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   SPRINT 9: Virtual Scroll + Loading de busca assíncrona
   ══════════════════════════════════════════════════════════════════════════ */

/* Spacers de virtual scroll (participam no layout flex de list/details) */
.mp-vscroll-spacer {
  display: block;
  width: 100%;
  pointer-events: none;
  flex-shrink: 0;
}

/* Loading de busca assíncrona */
/* ── Rubber-band selection ──────────────────────────────────────────────── */
.mp-explorer-rubber-band {
  position: fixed;
  display: none;
  border: 1px solid var(--mp-accent, #5294e2);
  background: rgba(82, 148, 226, 0.10);
  pointer-events: none;
  z-index: 9998;
  border-radius: 2px;
}
.mp-explorer-rubber-band.active {
  display: block;
}

.mp-explorer-searching {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.mp-explorer-spin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--mp-accent);
  border-radius: 50%;
  animation: mp-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Remove animação de entrada nos itens de virtual scroll (slice já tem display:contents) */
.mp-vscroll-spacer + * .mp-item,
.mp-explorer-items .mp-vscroll-spacer ~ * .mp-item {
  animation: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   PAINEL DE PRÉ-VISUALIZAÇÃO
   ══════════════════════════════════════════════════════════════════════════ */

.mp-explorer-preview-resizer {
  width: 4px;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  transition: background 0.15s;
}

.mp-explorer-preview-resizer:hover,
.mp-explorer-preview-resizer:active {
  background: rgba(var(--mp-accent-rgb), 0.35);
}

.mp-explorer-preview-pane {
  width: 220px;
  flex-shrink: 0;
  border-left: 1px solid var(--mp-window-border);
  background: rgba(255, 255, 255, 0.015);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.mp-explorer-preview-pane::-webkit-scrollbar { width: 4px; }
.mp-explorer-preview-pane::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}

/* Estado vazio */
.mp-explorer-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 24px 16px;
  text-align: center;
  pointer-events: none;
}

.mp-explorer-preview-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.20;
  color: rgba(255,255,255,0.80);
}

.mp-preview-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.40);
}

.mp-preview-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.22);
}

/* Conteúdo (arquivo selecionado) */
.mp-explorer-preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 16px;
  gap: 0;
}

/* Miniatura de imagem */
.mp-preview-thumb {
  width: 100%;
  max-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.20);
  margin-bottom: 12px;
}

.mp-preview-thumb img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  display: block;
}

/* Ícone emoji (não-imagem) */
.mp-preview-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.mp-preview-icon span {
  font-size: 48px;
  line-height: 1;
}

/* Nome do arquivo */
.mp-preview-name {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Metadados */
.mp-preview-meta {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-preview-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px;
  font-size: 11.5px;
}

.mp-preview-meta-key {
  color: rgba(255,255,255,0.30);
  flex-shrink: 0;
  font-size: 11px;
}

.mp-preview-meta-val {
  color: rgba(255,255,255,0.65);
  text-align: right;
  word-break: break-word;
  font-size: 11px;
}

/* ══════════════════════════════════════════════════════════════════════════
   NAV BUTTONS — estado ativo (sidebar-toggle e futuros)
   ══════════════════════════════════════════════════════════════════════════ */

/* Separador entre grupos de botões de navegação */
.mp-nav-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.10);
  margin: 0 3px;
  flex-shrink: 0;
}

/* Botão de navegação no estado "ativo" (ex.: sidebar visível) */
.mp-nav-btn.active {
  background: rgba(var(--mp-accent-rgb), 0.15);
  color: var(--mp-accent);
}

.mp-nav-btn.active:hover {
  background: rgba(var(--mp-accent-rgb), 0.25);
}

/* ══════════════════════════════════════════════════════════════════════════
   PAINEL DE PRÉ-VISUALIZAÇÃO — ícone do icon-pack
   ══════════════════════════════════════════════════════════════════════════ */

/* Quando o ícone vem do icon-pack (img real), garante dimensão correta */
.mp-preview-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

/* Utilitário para ocultar o painel via toggle */
.mp-hidden {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   DROP OVERLAY — arrastar arquivos do SO para o Explorer
   ══════════════════════════════════════════════════════════════════════════ */

/* Camada transparente que cobre o painel inteiro quando arquivos do SO são arrastados */
.mp-explorer-drop-overlay {
  position:       absolute;
  inset:          0;
  z-index:        200;
  display:        flex;
  align-items:    center;
  justify-content: center;
  background:     rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius:  inherit;
  pointer-events: none;  /* invisível por padrão → não bloqueia interações normais */
  opacity:        0;
  transition:     opacity 0.15s ease;
}

.mp-explorer-drop-overlay.visible {
  pointer-events: all;
  opacity:        1;
}

/* Caixa central com borda tracejada */
.mp-explorer-drop-box {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            12px;
  padding:        36px 48px;
  border:         2px dashed var(--mp-drop-target-border, var(--mp-accent, #3daee9));
  border-radius:  14px;
  background:     var(--mp-drop-target-bg, rgba(61, 174, 233, 0.08));
  color:          var(--mp-accent, #3daee9);
  pointer-events: none;
  user-select:    none;
  text-align:     center;
}

.mp-explorer-drop-box svg {
  opacity:        0.75;
}

.mp-explorer-drop-title {
  font-family:    var(--mp-font-ui, system-ui, sans-serif);
  font-size:      15px;
  font-weight:    600;
  color:          var(--mp-accent, #3daee9);
  letter-spacing: 0.01em;
}

.mp-explorer-drop-sub {
  font-family:    var(--mp-font-ui, system-ui, sans-serif);
  font-size:      12px;
  color:          rgba(255, 255, 255, 0.45);
  margin-top:     -6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   WP-4 — SESSÃO 2 FRENTE 2
   Item  6 — Modo Medium
   Item  7 — Sidebar resizer (largura persiste — sem CSS adicional além do existente)
   Item  8 — Breadcrumb editável
   Item  9 — Colunas redimensionáveis no modo Details
   Item 10 — Coluna "Criado em"
   Item 11 — Ghost de drag multi-item (via JS — sem CSS adicional)
   Item 40 — Shift-select (âncora correta — sem CSS)
   Item 41 — Cut indicator (já existia .mp-item.cut)
   Item 42 — Item de sistema (label + não selecionável)
   Item 46 — Árvore lazy com spinner na sidebar
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Item 6 — Modo Medium ─────────────────────────────────────────────────
   Grade compacta entre icons (80px) e tiles (200px).
   Ícone 32px, nome abaixo, gap menor.
   ─────────────────────────────────────────────────────────────────────── */

.mp-view-medium {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 3px;
  padding: 10px;
}

.mp-view-medium .mp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 60px;
  padding: 6px 3px 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}

.mp-view-medium .mp-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-view-medium .mp-item-emoji {
  font-size: 24px;
  line-height: 1;
}

.mp-view-medium .mp-item-name {
  font-size: 10.5px;
  text-align: center;
  line-height: 1.25;
  max-width: 56px;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Item 8 — Breadcrumb editável ─────────────────────────────────────────
   Input que substitui temporariamente o breadcrumb ao dar duplo clique.
   ─────────────────────────────────────────────────────────────────────── */

/* Quando o container está em modo de edição, alinha o input */
.mp-explorer-breadcrumb-wrap.mp-bc--editing {
  padding: 0 4px;
}

.mp-bc-path-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 22px;
  padding: 0 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--mp-font-mono, monospace);
  font-size: 12px;
  outline: none;
  caret-color: var(--mp-accent);
}

.mp-bc-path-input::placeholder {
  color: rgba(255, 255, 255, 0.30);
}

/* Flash de erro quando o caminho não existe */
@keyframes mp-bc-shake {
  0%, 100% { background: transparent; }
  25%       { background: rgba(218, 68, 83, 0.20); }
  75%       { background: rgba(218, 68, 83, 0.12); }
}

.mp-bc-path-input--error {
  animation: mp-bc-shake 0.55s ease;
  border-radius: 4px;
}

/* ── Item 9 — Colunas redimensionáveis no modo Details ────────────────────
   CSS custom properties controlam a largura de cada coluna.
   O cabeçalho (.mp-details-th) e as células (.mp-item-col) usam as vars.
   Handles de drag são posicionados absolutamente no fim de cada th.
   ─────────────────────────────────────────────────────────────────────── */

/* Defaults das variáveis (sobrescritas pelo JS com valores salvos) */
.mp-explorer-pane {
  --mp-col-date:    150px;
  --mp-col-created: 120px;
  --mp-col-type:    100px;
  --mp-col-size:     80px;
}

/* Coluna "nome" é flex: cresce para preencher o restante */
.mp-details-th--flex {
  flex: 1;
  min-width: 120px;
}

/* Colunas fixas — largura controlada por CSS vars */
.mp-details-th[data-col-key="date"]    { width: var(--mp-col-date);    }
.mp-details-th[data-col-key="created"] { width: var(--mp-col-created); }
.mp-details-th[data-col-key="type"]    { width: var(--mp-col-type);    }
.mp-details-th[data-col-key="size"]    { width: var(--mp-col-size);    }

/* Células de item — mesmas vars */
.mp-view-details .mp-item-date    { width: var(--mp-col-date);    flex-shrink: 0; }
.mp-view-details .mp-item-created { width: var(--mp-col-created); flex-shrink: 0; }
.mp-view-details .mp-item-type    { width: var(--mp-col-type);    flex-shrink: 0; }
.mp-view-details .mp-item-size    { width: var(--mp-col-size);    flex-shrink: 0; text-align: right; }

/* Handle de redimensionamento */
.mp-col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  border-radius: 0 3px 3px 0;
  z-index: 3;
}

/* Visível ao hover no th */
.mp-details-th:hover .mp-col-resize-handle,
.mp-col-resize-handle:hover,
.mp-col-resize-handle:active {
  background: rgba(var(--mp-accent-rgb), 0.40);
}

/* Garante que os th sejam posicionados relativamente para o handle */
.mp-details-th {
  position: relative;
}

/* ── Item 10 — Coluna "Criado em" ─────────────────────────────────────────
   Cor idêntica à coluna "Data de modificação".
   ─────────────────────────────────────────────────────────────────────── */

.mp-view-details .mp-item-created {
  color: rgba(255, 255, 255, 0.45);
}

/* Cabeçalho da coluna "Criado em" ordenável (destaque idêntico ao sorted) */
.mp-details-th[data-sort="created"].sorted {
  color: var(--mp-accent);
}

/* ── Item 42 — Indicador de item do sistema ("(sistema)") ──────────────────
   Itens com node.meta.system = true recebem .mp-item--system.
   Não são selecionáveis (cursor default, sem hover com destaque de seleção).
   ─────────────────────────────────────────────────────────────────────── */

.mp-item--system {
  cursor: default;
}

/* Sem destaque de seleção nem hover normal para itens de sistema */
.mp-item--system:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

.mp-item--system.selected {
  background: transparent !important;
}

.mp-item--system.selected .mp-item-name {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Badge "(sistema)" */
.mp-item-system-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 14px;
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
}

/* No modo icons/medium: badge centralizado abaixo do nome */
.mp-view-icons .mp-item-system-badge,
.mp-view-medium .mp-item-system-badge {
  margin-top: 2px;
}

/* No modo details: o tipo já inclui " (sistema)" como texto */

/* ── Item 46 — Árvore lazy na sidebar (QuickAccess) ────────────────────────
   Itens da árvore: indentados, toggle de expansão, spinner de carregamento.
   ─────────────────────────────────────────────────────────────────────── */

/* Wrapper dos itens da árvore — sem padding próprio */
.mp-qa-item-wrap {
  display: flex;
  flex-direction: column;
}

/* Filhos ficam levemente indentados */
.mp-qa-item-wrap--child {
  padding-left: 14px;
}

.mp-qa-children {
  display: flex;
  flex-direction: column;
}

/* Itens filhos são um pouco menores */
.mp-qa-item--child {
  font-size: 12px;
  padding: 4px 12px 4px 8px;
  color: rgba(255, 255, 255, 0.60);
}

.mp-qa-item--child .mp-qa-icon {
  font-size: 12px;
  width: 16px;
}

/* Botão toggle de expansão (◂ girado para ▾ quando expandido) */
.mp-qa-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  margin-right: 2px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color 0.1s, background 0.1s, transform 0.15s;
  transform: rotate(-90deg); /* apontando para direita = recolhido */
}

.mp-qa-tree-toggle svg {
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.mp-qa-tree-toggle:hover {
  color: rgba(255, 255, 255, 0.70);
  background: rgba(255, 255, 255, 0.08);
}

/* Expandido: seta aponta para baixo */
.mp-qa-tree-toggle.expanded {
  transform: rotate(0deg);
  color: rgba(255, 255, 255, 0.55);
}

/* Spinner de carregamento dos filhos */
.mp-qa-tree-spinner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px 3px 26px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.30);
}

.mp-qa-tree-spin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-top-color: var(--mp-accent);
  border-radius: 50%;
  animation: mp-spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes mp-spin {
  to { transform: rotate(360deg); }
}

/* Animação de entrada dos filhos quando expandidos */
@keyframes mp-qa-child-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mp-qa-item--entering {
  animation: mp-qa-child-in 0.15s ease both;
}

/* Cloud Download toolbar button */
.mp-cloud-dl-toolbar-btn,
.mp-cloud-ul-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, opacity 0.1s;
}

.mp-cloud-dl-toolbar-btn:hover:not(:disabled),
.mp-cloud-ul-toolbar-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.80);
}

.mp-cloud-dl-toolbar-btn:disabled {
  opacity: 0.30;
  cursor: default;
}

.mp-cloud-dl-toolbar-btn svg,
.mp-cloud-ul-toolbar-btn svg {
  width: 15px;
  height: 15px;
}

/* ── WP-7 Item 30: Seção de armazenamento cloud na sidebar ─────────────── */

/* Items da seção cloud herdam o estilo base mas têm algumas variações */
.mp-qa-item--cloud {
  /* mesma aparência base, apenas garantimos gap e overflow */
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  width: 100%;
}

.mp-qa-item--cloud .mp-qa-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Badge "ativo" dentro do botão cloud */
.mp-qa-item--cloud.active {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.90);
}

/* Ícone SVG do provider (16×16) */
.mp-qa-item--cloud .mp-qa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.mp-qa-item--cloud .mp-qa-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
