/* ==========================================================================
   Win95 Visual Component System
   Complete reusable UI library: windows, buttons, menus, taskbar,
   scrollbars, cursors, selection, resize handles, placeholder icons.
   All values reference tokens.css via var().
   ========================================================================== */


/* ==========================================================================
   1. Window Chrome
   ========================================================================== */

.win95-window {
  position: absolute;
  min-width: 300px;
  min-height: 200px;
  background: var(--win95-window-bg);
  box-shadow: var(--win95-outset);
  padding: 3px;
  display: flex;
  flex-direction: column;
  z-index: var(--z-windows);
}

.win95-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100vh - var(--win95-taskbar-height)) !important;
}

.win95-titlebar {
  height: var(--win95-titlebar-height);
  background: linear-gradient(90deg, var(--win95-window-title-active), #1084d0);
  display: flex;
  align-items: center;
  padding: 0 2px;
  gap: 4px;
  cursor: default;
  flex-shrink: 0;
}

.win95-titlebar.inactive {
  background: linear-gradient(90deg, var(--win95-window-title-inactive), #B5B5B5);
}

.win95-titlebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.win95-titlebar-text {
  font-family: var(--font-pixel);
  font-size: var(--font-size-xs);
  color: var(--win95-window-title-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}

.win95-titlebar-buttons {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.win95-titlebar-btn {
  width: 16px;
  height: 14px;
  background: var(--win95-button-face);
  box-shadow: var(--win95-outset-thin);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-family: var(--font-content);
  padding: 0;
  border: none;
  cursor: pointer;
  color: var(--win95-button-text);
  line-height: 1;
}

.win95-titlebar-btn:active {
  box-shadow: var(--win95-inset);
  padding-top: 1px;
}

.win95-titlebar-btn:focus-visible {
  outline: 1px dotted var(--win95-button-text);
  outline-offset: -2px;
}


/* ==========================================================================
   2. Window Menu Bar
   ========================================================================== */

.win95-menubar {
  height: var(--win95-menubar-height);
  background: var(--win95-window-bg);
  display: flex;
  align-items: center;
  padding: 0 2px;
  border-bottom: 1px solid var(--win95-border-dark);
  flex-shrink: 0;
}

.win95-menubar-item {
  font-family: var(--font-content);
  font-size: var(--font-size-base);
  padding: 2px 8px;
  cursor: default;
  user-select: none;
  color: var(--win95-button-text);
}

.win95-menubar-item:hover {
  background: var(--win95-menu-hover);
  color: var(--win95-menu-hover-text);
}


/* ==========================================================================
   3. Window Content Area
   ========================================================================== */

.win95-window-body {
  background: white;
  box-shadow: var(--win95-inset);
  margin: 2px;
  padding: 4px;
  overflow: auto;
  flex: 1;
  font-family: var(--font-content);
  font-size: var(--font-size-base);
  color: var(--win95-button-text);
}

/* Retro scrollbar styles (Chromium browsers) */
.win95-window-body::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.win95-window-body::-webkit-scrollbar-track {
  background: var(--win95-scrollbar-track);
  box-shadow: var(--win95-inset);
}

.win95-window-body::-webkit-scrollbar-thumb {
  background: var(--win95-button-face);
  box-shadow: var(--win95-outset);
  border: none;
}

.win95-window-body::-webkit-scrollbar-thumb:hover {
  background: var(--win95-border-dark);
}

.win95-window-body::-webkit-scrollbar-button {
  background: var(--win95-button-face);
  box-shadow: var(--win95-outset);
  width: 16px;
  height: 16px;
}

.win95-window-body::-webkit-scrollbar-button:active {
  box-shadow: var(--win95-inset);
}

.win95-window-body::-webkit-scrollbar-corner {
  background: var(--win95-window-bg);
}


/* ==========================================================================
   4. Status Bar
   ========================================================================== */

.win95-statusbar {
  height: var(--win95-statusbar-height);
  background: var(--win95-window-bg);
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 2px;
  flex-shrink: 0;
}

.win95-statusbar-section {
  box-shadow: var(--win95-inset);
  padding: 2px 6px;
  font-size: var(--font-size-sm);
  font-family: var(--font-content);
  color: var(--win95-button-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win95-statusbar-section:first-child {
  flex: 1;
}


/* ==========================================================================
   5. Beveled Buttons
   ========================================================================== */

.win95-btn {
  background: var(--win95-button-face);
  box-shadow: var(--win95-outset);
  border: none;
  font-family: var(--font-content);
  font-size: var(--font-size-base);
  color: var(--win95-button-text);
  padding: 4px 16px;
  cursor: pointer;
  min-width: 75px;
  text-align: center;
  user-select: none;
}

.win95-btn:active,
.win95-btn.pressed {
  box-shadow: var(--win95-inset);
  padding: 5px 15px 3px 17px;
}

.win95-btn:focus-visible {
  outline: 1px dotted var(--win95-button-text);
  outline-offset: -4px;
}

.win95-btn.default {
  border: 2px solid var(--win95-border-darker);
}

.win95-btn:disabled {
  color: var(--win95-border-dark);
  text-shadow: 1px 1px 0 var(--win95-border-light);
  cursor: default;
}


/* ==========================================================================
   6. Dropdown Menus (Start menu + context menu)
   ========================================================================== */

.win95-menu {
  position: absolute;
  background: var(--win95-menu-bg);
  box-shadow: var(--win95-outset);
  padding: 2px;
  min-width: 180px;
  display: none;
  z-index: var(--z-context-menu);
}

.win95-menu.visible {
  display: block;
}

.win95-menu-item {
  padding: 4px 24px 4px 28px;
  font-family: var(--font-content);
  font-size: var(--font-size-base);
  cursor: default;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
  color: var(--win95-button-text);
  user-select: none;
}

.win95-menu-item:hover {
  background: var(--win95-menu-hover);
  color: var(--win95-menu-hover-text);
}

.win95-menu-item.has-submenu::after {
  content: "\25BA";
  position: absolute;
  right: 8px;
  font-size: var(--font-size-xs);
}

.win95-menu-item.disabled {
  color: var(--win95-border-dark);
  pointer-events: none;
}

.win95-menu-item.disabled:hover {
  background: transparent;
}

.win95-menu-separator {
  height: 1px;
  margin: 2px 4px;
  border-top: 1px solid var(--win95-border-dark);
  border-bottom: 1px solid var(--win95-border-light);
}

.win95-menu-item-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

/* Start menu sidebar (vertical "Windows 95" text band) */
.win95-menu-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to top, var(--win95-window-title-active), #1084d0);
}

.win95-menu-sidebar-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-pixel);
  font-size: var(--font-size-sm);
  color: var(--win95-window-title-text);
  padding: var(--space-3);
  user-select: none;
}


/* ==========================================================================
   7. Taskbar Base Styles
   ========================================================================== */

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--win95-taskbar-height);
  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.35) 0%,
      rgba(255,255,255,0.15) 8%,
      transparent 14%) ,
    linear-gradient(to bottom,
      var(--xp-taskbar-start) 0%,
      var(--xp-taskbar-mid) 50%,
      var(--xp-taskbar-end) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 -1px 0 #0c2a78;
  display: flex;
  align-items: center;
  padding: 0 4px 0 0;
  z-index: var(--z-taskbar);
  gap: 4px;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 17px;
  padding: 0 22px 0 14px;
  height: 38px;
  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.30) 0%,
      rgba(255,255,255,0.05) 45%,
      transparent 50%),
    linear-gradient(to bottom,
      var(--xp-start-btn-start) 0%,
      var(--xp-start-btn-mid) 55%,
      var(--xp-start-btn-end) 100%);
  border: none;
  border-radius: 0 14px 14px 0;
  cursor: pointer;
  font-weight: bold;
  font-style: italic;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.18),
    1px 1px 2px rgba(0,0,0,0.25);
  transition: filter .12s ease;
}

.start-btn:hover {
  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.35) 0%,
      rgba(255,255,255,0.08) 45%,
      transparent 50%),
    linear-gradient(to bottom,
      var(--xp-start-btn-hover-start) 0%,
      var(--xp-start-btn-mid) 55%,
      var(--xp-start-btn-hover-end) 100%);
}

.start-btn:active,
.start-btn.pressed {
  background:
    linear-gradient(to bottom,
      var(--xp-start-btn-end) 0%,
      var(--xp-start-btn-mid) 50%,
      var(--xp-start-btn-start) 100%);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.35),
    inset 0 -1px 0 rgba(255,255,255,0.25);
}

.start-btn-icon {
  width: 22px;
  height: 22px;
  image-rendering: auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}

.taskbar-windows {
  display: flex;
  flex: 1;
  gap: 4px;
  overflow: hidden;
  padding: 4px 5px;
}

.taskbar-window-btn {
  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.28) 0%,
      rgba(255,255,255,0.06) 50%,
      transparent 55%),
    linear-gradient(to bottom, #4f7adb 0%, #2855b3 100%);
  border: 1px solid #1a3a82;
  border-radius: 3px;
  font-family: var(--font-content);
  font-size: var(--font-size-base);
  padding: 0 14px;
  height: 32px;
  cursor: pointer;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.18);
}

.taskbar-window-btn:hover {
  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.34) 0%,
      rgba(255,255,255,0.08) 50%,
      transparent 55%),
    linear-gradient(to bottom, #5a85e6 0%, #305fbe 100%);
}

.taskbar-window-btn.active {
  background:
    linear-gradient(to bottom, #1d3f8c 0%, #2855b3 100%);
  box-shadow:
    inset 1px 1px 3px rgba(0,0,0,0.4),
    inset 0 -1px 0 rgba(255,255,255,0.18);
  font-weight: bold;
}

.taskbar-clock {
  font-family: var(--font-pixel-readable);
  font-size: var(--font-size-base);
  padding: 0 14px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.25) 0%,
      rgba(255,255,255,0.05) 50%,
      transparent 55%),
    linear-gradient(to bottom, #1c46a4 0%, #133b8c 100%);
  box-shadow:
    inset 1px 1px 2px rgba(0,0,0,0.35),
    inset 0 -1px 0 rgba(255,255,255,0.15);
  min-width: 60px;
  text-align: center;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,0.18);
  margin: 3px 0;
}


/* ==========================================================================
   8. Cursor Classes
   ========================================================================== */

body {
  cursor: var(--cursor-default);
}

a,
button,
[role="button"],
.clickable {
  cursor: var(--cursor-pointer);
}

.cursor-wait,
.loading {
  cursor: var(--cursor-wait);
}

.cursor-move,
.dragging {
  cursor: var(--cursor-move);
}


/* ==========================================================================
   9. Selection Rectangle (drag-select)
   ========================================================================== */

.drag-select-rect {
  position: fixed;
  border: 1px dotted var(--win95-selection-bg);
  background: rgba(0, 0, 170, 0.15);
  pointer-events: none;
  display: none;
  z-index: var(--z-selection);
}

.drag-select-rect.active {
  display: block;
}


/* ==========================================================================
   10. Pixel Icon Placeholders
   Using CSS gradients to suggest pixel-art shapes.
   These are PLACEHOLDERS until Diego provides real .png assets.
   NOTE: Hex colors used here are intentional for icon artwork only.
   ========================================================================== */

.icon-placeholder {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  image-rendering: pixelated;
  display: block;
}

/* Yellow folder icon */
.icon-folder {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  background:
    linear-gradient(135deg, #FFD700 0%, #FFD700 40%, transparent 40%) no-repeat 0 4px / 20px 8px,
    linear-gradient(to bottom, #FFC107 0%, #FFA000 100%) no-repeat 0 10px / 30px 20px;
  border-radius: 1px;
  image-rendering: pixelated;
}

/* XP-style My Computer icon — silver/beige CRT with blue screen, stand and base */
.icon-computer {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  background-image: url('data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IiB3aWR0aD0iMjMiIGhlaWdodD0iMTMiIGZpbGw9InVybCgjc2NyZWVuRykiLz4KPHBhdGggZD0iTTQuNSA1IEwxNyA1IEw4IDExIFoiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xOCkiLz4KPHJlY3QgeD0iNCIgeT0iMTkiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyLjUiIGZpbGw9IiNiY2I4OWUiLz4KPGNpcmNsZSBjeD0iMjUuNSIgY3k9IjIwLjI1IiByPSIwLjQ1IiBmaWxsPSIjM2ZjYzFhIi8+CjxjaXJjbGUgY3g9IjYiIGN5PSIyMC4yNSIgcj0iMC40NSIgZmlsbD0iIzg4OCIgb3BhY2l0eT0iMC44Ii8+CjxyZWN0IHg9IjEzIiB5PSIyMiIgd2lkdGg9IjYiIGhlaWdodD0iMiIgZmlsbD0idXJsKCNzdGFuZEcpIi8+CjxyZWN0IHg9IjgiIHk9IjI0IiB3aWR0aD0iMTYiIGhlaWdodD0iMyIgcng9IjAuNiIgZmlsbD0idXJsKCNjYXNlRykiIHN0cm9rZT0iIzVkNWI1MCIgc3Ryb2tlLXdpZHRoPSIwLjQiLz4KPGxpbmUgeDE9IjkiIHkxPSIyNiIgeDI9IjIzIiB5Mj0iMjYiIHN0cm9rZT0icmdiYSgwLDAsMCwwLjE1KSIgc3Ryb2tlLXdpZHRoPSIwLjMiLz4KPC9zdmc+Cg==');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}

/* XP-style Recycle Bin (empty) — translucent blue plastic with vertical ribs */
.icon-recycle-bin {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  position: relative;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgo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KSIgc3Ryb2tlPSIjM2E1ZDhjIiBzdHJva2Utd2lkdGg9IjAuNSIvPgo8cGF0aCBkPSJNMTMgNiBMMTkgNiBMMTguNSA3LjUgTDEzLjUgNy41IFoiIGZpbGw9IiM3ZGEwY2UiIHN0cm9rZT0iIzNhNWQ4YyIgc3Ryb2tlLXdpZHRoPSIwLjQiLz4KPHBhdGggZD0iTTEzIDggcTMgMS42IDYgMCIgc3Ryb2tlPSJyZ2JhKDI1NSwyNTUsMjU1LDAuNikiIHN0cm9rZS13aWR0aD0iMC41IiBmaWxsPSJub25lIi8+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDExLjUsMTIpIHNjYWxlKDAuNDIpIiBmaWxsPSIjZmZmZmZmIj4KPHBhdGggZD0iTTkgMSBMMTMgNSBMMTEuNSA1IEwxMS41IDkgTDguNSA5IEw4LjUgNSBMNyA1IFogTTUgMTEgTDkgMTEgTDkgMTMgTDUgMTMgWiBNMTEgMTEgTDE1IDExIEwxNSAxMyBMMTEgMTMgWiIgb3BhY2l0eT0iMC44Ii8+CjwvZz4KPC9zdmc+Cg==');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}

/* Recycle Bin (full) — papers spilling over rim */
.icon-recycle-bin.full {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJiaW5Cb2R5MiIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjAiPgo8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2MzkxYzkiLz48c3RvcCBvZmZzZXQ9IjAuNSIgc3RvcC1jb2xvcj0iI2E4YzVlOCIvPjxzdG9wIG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9rZS13aWR0aD0iMC41Ii8+CjxwYXRoIGQ9Ik0xMyA2IEwxOSA2IEwxOC41IDcuNSBMMTMuNSA3LjUgWiIgZmlsbD0iIzdkYTBjZSIgc3Ryb2tlPSIjM2E1ZDhjIiBzdHJva2Utd2lkdGg9IjAuNCIvPgo8L3N2Zz4K');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Blue/green globe icon */
.icon-globe {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  background: radial-gradient(circle at 40% 40%, #4488FF 0%, #2266CC 40%, #116633 60%, #228844 80%, #2266CC 100%);
  border-radius: 50%;
  image-rendering: pixelated;
}

/* Envelope / mail icon */
.icon-mail {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  background:
    linear-gradient(135deg, #F0F0F0 25%, transparent 25%) no-repeat 0 6px / 16px 10px,
    linear-gradient(225deg, #F0F0F0 25%, transparent 25%) no-repeat 16px 6px / 16px 10px,
    linear-gradient(to bottom, #E8E8E8 0%, #D0D0D0 100%) no-repeat 0 6px / 32px 20px;
  image-rendering: pixelated;
}

/* Play button / media icon */
.icon-media {
  width: var(--win95-icon-size);
  height: var(--win95-icon-size);
  background:
    linear-gradient(to bottom, #333333 0%, #1A1A1A 100%) no-repeat 2px 2px / 28px 28px;
  position: relative;
  image-rendering: pixelated;
}

.icon-media::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #FFFFFF;
}


/* ==========================================================================
   11. Window Resize Handles
   ========================================================================== */

.win95-resize-handle {
  position: absolute;
  z-index: 1;
}

.win95-resize-n {
  top: -3px;
  left: 0;
  right: 0;
  height: 6px;
  cursor: n-resize;
}

.win95-resize-s {
  bottom: -3px;
  left: 0;
  right: 0;
  height: 6px;
  cursor: s-resize;
}

.win95-resize-e {
  right: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: e-resize;
}

.win95-resize-w {
  left: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: w-resize;
}

.win95-resize-ne {
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  cursor: ne-resize;
}

.win95-resize-nw {
  top: -3px;
  left: -3px;
  width: 10px;
  height: 10px;
  cursor: nw-resize;
}

.win95-resize-se {
  bottom: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  cursor: se-resize;
}

.win95-resize-sw {
  bottom: -3px;
  left: -3px;
  width: 10px;
  height: 10px;
  cursor: sw-resize;
}

/* Grip indicator in bottom-right corner */
.win95-resize-grip {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(135deg,
      transparent 30%,
      var(--win95-border-light) 30%, var(--win95-border-light) 35%,
      transparent 35%, transparent 45%,
      var(--win95-border-light) 45%, var(--win95-border-light) 50%,
      transparent 50%, transparent 60%,
      var(--win95-border-light) 60%, var(--win95-border-light) 65%,
      transparent 65%
    );
  cursor: se-resize;
  z-index: 1;
}


/* ==========================================================================
   12. Utility & State Classes
   ========================================================================== */

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible for keyboard navigation */
.win95-window:focus-visible {
  outline: 2px solid var(--win95-accent-cyan);
  outline-offset: 1px;
}

/* Text selection */
::selection {
  background: var(--win95-selection-bg);
  color: var(--win95-selection-text);
}


/* ==========================================================================
   13. File Explorer (Mi Computadora)
   ========================================================================== */

/* Strip default window-body padding so explorer fills the space */
#window-mi-computadora .win95-window-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--win95-window-bg);
}

.fe-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.fe-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--win95-window-bg);
  border-bottom: 1px solid var(--win95-border-dark);
  flex-shrink: 0;
}

.fe-nav-btn {
  min-width: 28px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: bold;
}

.fe-nav-btn:disabled {
  color: var(--win95-border-dark);
  text-shadow: 1px 1px 0 var(--win95-border-light);
  cursor: default;
}

.fe-address-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.fe-address-label {
  font-size: 11px;
  white-space: nowrap;
  font-family: var(--font-content);
  color: var(--win95-button-text);
}

.fe-address-value {
  flex: 1;
  box-shadow: var(--win95-inset);
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-content);
  background: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--win95-button-text);
}

.fe-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.fe-sidebar {
  width: 150px;
  flex-shrink: 0;
  border-right: 2px solid var(--win95-border-dark);
  overflow-y: auto;
  font-size: 11px;
  padding: 2px 0;
  background: var(--win95-window-bg);
}

.fe-tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  font-family: var(--font-content);
  color: var(--win95-button-text);
  user-select: none;
}

.fe-tree-item:hover {
  background: var(--win95-menu-hover);
  color: var(--win95-menu-hover-text);
}

.fe-tree-item.fe-active {
  background: var(--win95-selection-bg);
  color: var(--win95-selection-text);
}

.fe-drive {
  font-weight: bold;
  border-top: 1px solid var(--win95-border-mid);
  margin-top: 2px;
  padding-top: 4px;
}

.fe-drive:first-child {
  border-top: none;
  margin-top: 0;
}

.fe-tree-icon {
  font-size: 13px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.fe-tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.fe-content {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  padding: 8px;
  overflow-y: auto;
  background: white;
  box-shadow: var(--win95-inset);
}

.fe-content-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 76px;
  padding: 6px 4px 4px;
  gap: 4px;
  cursor: default;
  text-align: center;
  border: 1px solid transparent;
  user-select: none;
  font-family: var(--font-content);
}

.fe-content-item:hover {
  background: rgba(0, 0, 170, 0.1);
  border-color: rgba(0, 0, 170, 0.3);
}

.fe-content-icon {
  font-size: 28px;
  line-height: 1;
}

.fe-content-name {
  font-size: 10px;
  line-height: 1.2;
  word-break: break-word;
  color: var(--win95-button-text);
  max-width: 72px;
}

.fe-statusbar {
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--font-content);
  border-top: 1px solid var(--win95-border-dark);
  box-shadow: var(--win95-inset);
  flex-shrink: 0;
  color: var(--win95-button-text);
}

.fe-empty {
  padding: 16px;
  font-size: 12px;
  color: var(--win95-border-dark);
  font-style: italic;
  font-family: var(--font-content);
}


/* ==========================================================================
   14. Recycle Bin Window
   ========================================================================== */

#window-papelera .win95-window-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rb-root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--win95-window-bg);
  border-bottom: 1px solid var(--win95-border-dark);
  flex-shrink: 0;
}

.rb-empty-btn {
  font-weight: bold;
}

.rb-count {
  font-size: 11px;
  color: var(--win95-border-dark);
  font-family: var(--font-content);
}

.rb-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  background: white;
}

.rb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-content);
  color: var(--win95-button-text);
  border-bottom: 1px solid #F0F0F0;
}

.rb-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.rb-empty {
  padding: 16px;
  color: var(--win95-border-dark);
  font-size: 12px;
  font-style: italic;
  font-family: var(--font-content);
}
