/* desktop.css -- Hyprland Rice dark glass desktop, icons, wallpapers, context menu */

/* ── Desktop ── */
#desktop {
  position: fixed;
  inset: 0;
  top: calc(var(--bar-height) + 8px);
  bottom: 0;
  background: var(--bg-primary);
  overflow: hidden;
}

#desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  padding: 16px;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* ── Icon ── */
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96px;
  padding: 10px 6px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.desktop-icon .icon-img {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  font-size: 28px;
  color: var(--accent-secondary);
  transition: all var(--transition-fast);
}

.desktop-icon .icon-img img {
  max-width: 60px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.desktop-icon .icon-label {
  font-size: 12px;
  color: var(--text-primary);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  font-family: var(--font-ui);
  word-wrap: break-word;
  max-width: 96px;
  line-height: 1.3;
}

.desktop-icon.selected {
  background: rgba(124, 58, 237, 0.15);
}

.desktop-icon.selected .icon-img img {
  filter: drop-shadow(0 0 8px var(--accent-glow-strong)) drop-shadow(0 0 16px var(--accent-glow-bleed));
}

.desktop-icon.selected .icon-label {
  text-shadow: 0 0 8px var(--accent-glow-bleed), 0 0 16px rgba(124, 58, 237, 0.15);
}

.desktop-icon:hover .icon-img img {
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.2)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.1));
}

/* ── Context Menu ── */
#context-menu {
  position: fixed;
  background: var(--bg-surface);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-menu);
  padding: 4px 0;
  min-width: 180px;
  z-index: 2000;
  font-family: var(--font-ui);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.ctx-item {
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.ctx-item:hover {
  background: rgba(124, 58, 237, 0.2);
  color: #fff;
}

.ctx-separator {
  height: 1px;
  margin: 4px 8px;
  background: var(--glass-border);
}

/* ── Video Wallpaper ── */
#desktop-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Default center */
  z-index: 0;
  opacity: 0.4;
}

/* Computer wallpaper: show monitors and face */
#desktop-video[src*="wp-pixel-computer"] {
  object-position: center center;
}

/* Beach wallpaper: shift left to center person on desktop */
#desktop-video[src*="wp-pixel-beach"] {
  object-position: 20% center;
}
