/* ══════════════════════════════════════════════
   BUREAU VIRTUEL — CSS Windows 10/11
══════════════════════════════════════════════ */

/* ─── ROOT BUREAU ─── */
#desktop-root {
  position: fixed; top: 44px; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  background: #1a3a6b;
  font-family: 'Segoe UI', 'Nunito', sans-serif;
  overflow: hidden;
  user-select: none;
}

/* ─── FOND BUREAU ─── */
#desktop-area {
  flex: 1; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1a3a6b 0%, #0d1f40 40%, #1a2a50 100%);
}

/* ─── BARRE DES TÂCHES ─── */
#taskbar {
  height: 40px; background: rgba(0,0,0,.75);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; border-top: 1px solid rgba(255,255,255,.1);
  order: 2;
  z-index: 1000;
}
#taskbar-left  { display: flex; align-items: center; gap: 4px; }
#taskbar-right { display: flex; align-items: center; gap: 8px; padding-right: 8px; }

#start-btn {
  width: 40px; height: 40px; background: transparent; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: background .15s;
}
#start-btn:hover { background: rgba(255,255,255,.1); }

#taskbar-apps { display: flex; gap: 2px; }
.taskbar-app {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px; padding: 4px 12px; color: #fff;
  font-size: .78rem; cursor: pointer; transition: background .15s;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.taskbar-app:hover { background: rgba(255,255,255,.18); }

#taskbar-clock { color: #fff; font-size: .75rem; text-align: right; cursor: default; padding: 0 8px; }

/* ─── ICÔNES BUREAU ─── */
#desktop-icons { position: absolute; inset: 0; }

.desktop-icon {
  position: absolute; width: 72px; cursor: default;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px; border-radius: 4px; transition: background .1s;
}
.desktop-icon:hover   { background: rgba(255,255,255,.1); }
.desktop-icon.selected { background: rgba(0,120,215,.4); border: 1px solid rgba(0,120,215,.6); }
.desktop-icon.dragging { opacity: .7; cursor: grabbing; z-index: 999; }
.desktop-icon.drop-target { background: rgba(26,158,122,.3); border: 2px dashed #1a9e7a; }

.icon-img   { font-size: 2rem; line-height: 1; }
.icon-label {
  font-size: .7rem; color: #fff; text-align: center; word-break: break-word;
  text-shadow: 1px 1px 2px rgba(0,0,0,.8); max-width: 68px;
  line-height: 1.2;
}

.rename-input {
  background: #fff; color: #000; border: 2px solid #0078d4;
  border-radius: 2px; font-size: .7rem; text-align: center;
  padding: 1px 3px; width: 68px; outline: none;
}

/* ─── FENÊTRES ─── */
#windows-layer { position: absolute; inset: 0; pointer-events: none; }

.win-window {
  position: absolute; pointer-events: all;
  background: #fff; border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.2);
  min-width: 280px; overflow: hidden;
  transition: opacity .15s;
}
.win-window.minimized { display: none; }
.win-window.maximized {
  left: 0 !important; top: 0 !important;
  width: 100% !important; height: calc(100% - 0px) !important;
}

.win-titlebar {
  height: 32px; background: #f3f3f3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 12px; cursor: move;
  border-bottom: 1px solid #e0e0e0;
}
.win-title { font-size: .82rem; color: #333; font-weight: 500; user-select: none; }
.win-controls { display: flex; gap: 0; }
.win-btn {
  width: 46px; height: 32px; border: none; background: transparent;
  font-size: .8rem; cursor: pointer; transition: background .1s; color: #333;
}
.win-btn:hover    { background: #e0e0e0; }
.win-close:hover  { background: #c42b1c !important; color: #fff; }
.win-body { background: #fff; color: #000; font-size: .85rem; overflow: auto; }

/* ─── MENU CONTEXTUEL ─── */
.context-menu {
  position: fixed; z-index: 2000;
  background: rgba(243,243,243,.96); backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,.12); border-radius: 8px;
  padding: 4px 0; min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.ctx-item {
  padding: 8px 16px; font-size: .82rem; color: #333; cursor: pointer;
  transition: background .1s;
}
.ctx-item:hover { background: rgba(0,120,215,.12); }
.ctx-highlight  { color: #0078d4; font-weight: 700; }
.ctx-sep { height: 1px; background: #e0e0e0; margin: 4px 8px; }

/* ─── MENU DÉMARRER ─── */
.start-menu {
  position: fixed; bottom: 40px; left: 0; z-index: 1500;
  background: rgba(30,30,50,.95); backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 0 12px 0 0;
  width: 280px; padding: 16px 0;
  box-shadow: 4px -4px 24px rgba(0,0,0,.5);
}
.start-header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 20px 16px; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px;
}
.start-apps { padding: 8px 0; }
.start-app {
  padding: 10px 20px; color: #fff; cursor: pointer; font-size: .88rem;
  transition: background .15s;
}
.start-app:hover { background: rgba(255,255,255,.1); }
.start-footer {
  padding: 12px 20px 0; border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 8px;
}
.start-power {
  color: #fff; cursor: pointer; font-size: .85rem; padding: 6px 0;
  transition: color .15s;
}
.start-power:hover { color: #ff6b6b; }

/* ─── BANDEAU DÉFI ─── */
#challenge-banner {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(13,13,26,.88); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,215,0,.3); border-radius: 14px;
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
  max-width: 560px; width: 90%; z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  transition: background .3s;
}
#challenge-banner.challenge-pulse {
  background: rgba(26,158,122,.4);
}
#challenge-icon { font-size: 1.5rem; flex-shrink: 0; }
#challenge-text {
  font-size: .88rem; color: #f0eeff; line-height: 1.4; flex: 1;
  font-family: 'Nunito', sans-serif; font-weight: 600;
}
#challenge-progress-wrap { flex-shrink: 0; }
#challenge-progress-dots { display: flex; gap: 5px; }
.challenge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  transition: all .3s;
}
.challenge-dot.done    { background: #1a9e7a; border-color: #1a9e7a; }
.challenge-dot.current { background: #ffd700; border-color: #ffd700; transform: scale(1.3); }

/* ─── NOTIFICATION WINDOWS ─── */
.win-notif {
  position: fixed; bottom: 52px; right: 12px; z-index: 2000;
  background: rgba(30,30,46,.95); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 14px 16px; width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: flex; align-items: flex-start; gap: 12px;
  animation: notif-in .3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes notif-in { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.win-notif-icon { font-size: 1.8rem; flex-shrink: 0; }
.win-notif-body { flex: 1; }
.win-notif-title { font-size: .75rem; font-weight: 800; color: #6c4de0; letter-spacing: .5px; margin-bottom: 4px; text-transform: uppercase; }
.win-notif-msg   { font-size: .88rem; color: #f0eeff; line-height: 1.4; font-family: 'Nunito', sans-serif; }
.win-notif-close {
  background: none; border: none; color: #b8b0e0;
  font-size: .9rem; cursor: pointer; padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.win-notif-close:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ─── CMD ─── */
#cmd-root textarea, #cmd-root input { caret-color: #fff; }
