/* ═══════════════════════════════════════════════════════════
   FileOS Desktop — Icons CSS
   Desktop icons with grid snap, drag-drop, multi-select
   ═══════════════════════════════════════════════════════════ */

/* ── Icon ── */
.desktop-icon {
  position: absolute;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
  z-index: 1;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.desktop-icon.selected {
  background: var(--accent-light);
  border-color: rgba(0, 120, 212, 0.35);
}

.desktop-icon.selected:hover {
  background: rgba(0, 120, 212, 0.22);
  border-color: rgba(0, 120, 212, 0.45);
}

.desktop-icon.dragging {
  opacity: 0.55;
  z-index: 100;
}

.desktop-icon.drop-target {
  background: rgba(0, 120, 212, 0.15);
  border-color: var(--accent);
  border-style: dashed;
}

/* ── Icon Image ── */
.desktop-icon-img {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.desktop-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Icon Label ── */
.desktop-icon-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 0, 0, 0.5);
  line-height: 1.3;
  max-width: 74px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  pointer-events: none;
}

.desktop-icon.selected .desktop-icon-label {
  text-shadow: none;
}

/* ── Rename Input ── */
.desktop-icon-rename {
  width: 74px;
  padding: 1px 4px;
  font-size: 11px;
  font-family: var(--font-family);
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--text-primary);
  outline: none;
}

/* ── Icon Type Badges ── */
.desktop-icon[data-type="folder"] .desktop-icon-img {
  font-size: 40px;
}

.desktop-icon[data-type="app"]::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}

.desktop-icon[data-type="database"]::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 4px var(--orange);
}

/* ── Ghost drag preview ── */
.icon-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.icon-drag-ghost .count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
