/* css/desktop.css */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  user-select: none;
}

/* ── Aviso móvil ── */
#mobile-warning {
  display: none;
  position: fixed; inset: 0;
  background: #000c1a;
  color: white;
  font-family: Tahoma, sans-serif;
  align-items: center; justify-content: center;
  flex-direction: column;
  text-align: center; gap: 12px;
  z-index: 99999; padding: 24px;
}
#mobile-warning h2 { font-size: 20px; margin: 8px 0 4px; }
#mobile-warning p  { color: #aaa; font-size: 13px; line-height: 1.6; }

@media (max-width: 768px) {
  #mobile-warning { display: flex; }
  #os-wrapper     { display: none; }
}

/* ── OS Wrapper ── */
#os-wrapper {
  min-width: 1024px;
  width: 100vw; height: 100vh;
  overflow: hidden; position: relative;
  background: #000;  /* ← NUEVO: evita flash azul entre BIOS y bootscreen */
}

/* ── Fondo escritorio ── */
body {
  background: #000;  /* ← CAMBIADO: negro hasta que wallpapers.js aplique el fondo */
}

/* ── Escritorio ── */
#desktop {
  position: absolute; top: 0; left: 0; right: 0; bottom: 42px;
  display: flex; flex-direction: column; flex-wrap: wrap;
  align-content: flex-start;
  padding: 16px 10px; gap: 8px;
}

/* ── Iconos ── */
.desktop-icon {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 5px; width: 82px; height: 82px;
  background: transparent; border: 1px solid transparent;
  border-radius: 4px; color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,.85);
  cursor: pointer; padding: 6px 4px;
  transition: background .1s, border-color .1s;
  font-family: Tahoma, sans-serif; font-size: 11px;
}
.desktop-icon:hover    { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.55); }
.desktop-icon.selected { background: rgba(50,120,255,.45);  border-color: rgba(255,255,255,.75); outline: none; }
.desktop-icon img      { width: 40px; height: 40px; object-fit: contain; }
.desktop-icon span     { text-align: center; line-height: 1.25; max-width: 76px; word-break: break-word; }

/* ── Escritorio estilo XP (iconos móviles) ── */
#desktop.xp { display: block; padding: 0; }
#desktop.xp .desktop-icon {
  position: absolute;
  width: 76px; height: 78px;
  padding: 5px 3px;
  transition: none;
}
#desktop.xp .desktop-icon.dragging { opacity: .7; z-index: 50; }
#desktop.xp .desktop-icon:focus    { outline: none; }

.desktop-marquee {
  position: absolute;
  border: 1px solid rgba(140,185,255,.95);
  background: rgba(90,150,255,.22);
  z-index: 40;
  pointer-events: none;
}

.desktop-ctx {
  position: fixed;
  min-width: 168px;
  background: #f6f5ee;
  border: 1px solid #7a7a6a;
  box-shadow: 2px 2px 7px rgba(0,0,0,.4);
  font-family: Tahoma, Arial, sans-serif; font-size: 12px;
  padding: 2px;
  z-index: 999990;
}
.desktop-ctx .ctx-item {
  padding: 4px 24px 4px 12px;
  border-radius: 2px;
  white-space: nowrap;
}
.desktop-ctx .ctx-item:hover { background: #2458b8; color: #fff; }
.desktop-ctx .ctx-sep { height: 1px; background: #c8c8bc; margin: 3px 2px; }

/* ── Tooltip reloj ── */
#clock-tooltip {
  position: fixed; bottom: 50px; right: 8px;
  background: #ffffd0; border: 1px solid #888;
  padding: 4px 10px; font-size: 11px;
  font-family: Tahoma, sans-serif;
  box-shadow: 2px 2px 4px rgba(0,0,0,.3);
  display: none; z-index: 9999;
  pointer-events: none;
}

/* ── Modal nombre ── */
#modal-name {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
#modal-name.hidden { display: none; }

.modal-box {
  background: #ece9d8; border: 2px solid #0a3ba8;
  border-radius: 4px; width: 340px; overflow: hidden;
  box-shadow: 4px 4px 16px rgba(0,0,0,.5);
}
.modal-title-bar {
  background: linear-gradient(90deg, #0a3ba8, #3080e8);
  color: white; padding: 6px 10px;
  font-weight: bold; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.modal-body           { padding: 18px; font-size: 12px; }
.modal-body p         { margin-bottom: 12px; color: #222; line-height: 1.6; }
.modal-body input {
  width: 100%; padding: 6px 8px;
  font-family: Tahoma, sans-serif; font-size: 13px;
  border: 1px solid #7b7461; border-radius: 3px;
  margin-bottom: 8px; outline: none;
}
.modal-body input:focus { border-color: #245edb; box-shadow: 0 0 0 2px rgba(36,94,219,.2); }
.modal-submit {
  width: 100%; padding: 8px;
  background: linear-gradient(180deg, #3c92f5, #1a5edb);
  color: white; border: 1px solid #0a3ba8; border-radius: 3px;
  cursor: pointer; font-family: Tahoma, sans-serif;
  font-weight: bold; font-size: 12px;
}
.modal-submit:hover { background: linear-gradient(180deg, #5aaaf8, #2870e8); }

/* ── Notificaciones OS ── */
#notification-tray {
  position: fixed;
  bottom: 52px; right: 10px;
  display: flex; flex-direction: column;
  gap: 6px; z-index: 9800;
  pointer-events: none;
}

.os-notification {
  display: flex; align-items: flex-start; gap: 8px;
  width: 280px;
  background: #fffbe6; border: 1px solid #d4b800;
  border-radius: 4px; padding: 8px 10px;
  box-shadow: 2px 2px 8px rgba(0,0,0,.25);
  font-family: Tahoma, sans-serif; font-size: 11px;
  pointer-events: all;
  opacity: 0; transform: translateX(20px);
  transition: opacity .25s, transform .25s;
}
.os-notification.notif-visible { opacity: 1; transform: translateX(0); }
.os-notification.notif-exit    { opacity: 0; transform: translateX(20px); }

.notif-icon  { font-size: 18px; flex-shrink: 0; }
.notif-title { font-weight: bold; color: #333; margin-bottom: 2px; }
.notif-body  { color: #555; line-height: 1.4; }
.notif-close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; font-size: 10px; color: #888;
  flex-shrink: 0; padding: 0 2px;
}
.notif-close:hover { color: #333; }

/* ── Utilidades ── */
.hidden     { display: none !important; }
.form-error { color: #c00; font-size: 11px; margin-top: 4px; }

.desktop-icon .icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-icon .icon-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  background: #e02020;
  color: white;
  font-size: 9px;
  font-weight: bold;
  border-radius: 8px;
  border: 1.5px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  pointer-events: none;
  z-index: 10;
}