* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e5e7eb;
  background: #020617;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
#desktop, #taskbar, .window, .widget, .panel, #start-menu, #dock { transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }

/* Escritorio */
#desktop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  z-index: 0;
}

/* Capa de ventanas y widgets */
#window-layer,
#widget-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.window,
.widget {
  position: absolute;
  pointer-events: auto;
}

/* Barra de tareas */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 40px;
  width: 100%;
  background: rgba(15,23,42,0.93);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 100;
}

#taskbar-left,
#taskbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.taskbar-app-button,
.taskbar-icon {
  background: rgba(148,163,184,0.18);
  border: 1px solid rgba(148,163,184,0.4);
  border-radius: 999px;
  color: #e5e7eb;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.taskbar-app-button:hover,
.taskbar-icon:hover {
  background: rgba(148,163,184,0.3);
  transform: translateY(-1px);
}

#taskbar-clock {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
}

/* Ventanas estilo macOS */
.window {
  min-width: 260px;
  min-height: 160px;
  background: rgba(15,23,42,0.94);
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 18px 45px rgba(0,0,0,0.6);
  overflow: hidden;

  /* Animaciones suaves */
  opacity: 0;
  transform: scale(0.96) translateY(6px);
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.window.focused {
  border-color: #38bdf8;
  box-shadow: 0 22px 55px rgba(56,189,248,0.35);
}


.window-header {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  background: linear-gradient(to right, rgba(15,23,42,0.95), rgba(30,64,175,0.65));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148,163,184,0.6);
  cursor: move;
  user-select: none;
}

.window-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.8);
}

.window-btn-close {
  background: #f97373;
}

.window-btn-minimize {
  background: #facc15;
}

.window-btn-maximize {
  background: #4ade80;
}

.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
}

.window-content {
  padding: 10px;
  font-size: 14px;
}

/* Ventana enfocada */
.window.focused {
  border-color: #38bdf8;
}

/* Widgets simples */
.widget {
  background: rgba(15,23,42,0.92);
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.6);
  padding: 8px;
  color: #e5e7eb;
  min-width: 160px;
  box-shadow: 0 14px 35px rgba(0,0,0,0.5);
}

/* Control Center */
.panel {
  position: fixed;
  right: 8px;
  bottom: 50px;
  width: 260px;
  background: rgba(15,23,42,0.96);
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
  padding: 12px;
  z-index: 120;
  backdrop-filter: blur(18px);
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.cc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.cc-row button {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(30,64,175,0.7);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
}

.hidden {
  display: none;
}

/* Mission Control overlay */
#mission-control-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(2,6,23,0.98));
  z-index: 150;
  padding: 12px;
  color: #e5e7eb;
}

#mission-control-overlay h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

#mission-control-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-control-item {
  background: rgba(15,23,42,0.9);
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

/* Notificaciones */
#notifications-container {
  position: fixed;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 200;
}

.notification {
  background: rgba(15,23,42,0.96);
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.7);
  padding: 8px 10px;
  min-width: 180px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(-6px);
  animation: notif-in 0.2s forwards;
}

@keyframes notif-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tema oscuro/claro simple */
body.light-theme #desktop {
  background: radial-gradient(circle at top, #e5e7eb 0, #94a3b8 55%);
}

body.light-theme #taskbar {
  background: rgba(226,232,240,0.95);
  color: #0f172a;
}

body.light-theme .window,
body.light-theme .widget {
  background: rgba(248,250,252,0.98);
  color: #0f172a;
}

#dock {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(15,23,42,0.85);
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.5);
  backdrop-filter: blur(18px);
  z-index: 90;
}

.dock-item {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.dock-item:hover {
  transform: translateY(-4px) scale(1.06);
  background: rgba(148,163,184,0.25);
}

#start-menu {
  position: fixed;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  background: rgba(15,23,42,0.96);
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 24px 60px rgba(0,0,0,0.75);
  z-index: 120;
}

.start-inner {
  padding: 12px;
}

.start-inner h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.start-apps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.start-app {
  background: rgba(148,163,184,0.15);
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.5);
  padding: 6px 8px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
  display:flex;
  align-items:center;
  gap:6px;
}

.start-app:hover {
  background: rgba(148,163,184,0.25);
}
