/* ════════════════════════════════════════════════════════
   WINDOWS VISTA DESKTOP — style.css
   Estética Aero Glass: transparencias, blur, brillos
════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;600;700&display=swap');

/* ── Variables de color Vista/Aero ── */
:root {
  --aero-blue:      rgba(40, 100, 190, 0.55);
  --aero-blue-dark: rgba(15,  55, 130, 0.75);
  --aero-glass:     rgba(200, 225, 255, 0.18);
  --aero-glass-2:   rgba(180, 210, 255, 0.28);
  --aero-border:    rgba(150, 200, 255, 0.55);
  --aero-shine:     rgba(255, 255, 255, 0.45);
  --titlebar-h:     32px;
  --taskbar-h:      40px;
  --text-light:     #e8f0ff;
  --text-dim:       rgba(200, 220, 255, 0.7);
  --accent:         #5ba3f5;
  --shadow-win:     0 8px 40px rgba(0,0,50,0.55), 0 2px 8px rgba(0,0,80,0.4);
}

/* ── Reset base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ════════════════════════════════════════════════════════
   ESCRITORIO
════════════════════════════════════════════════════════ */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  user-select: none;
  height: 100vh;
  width: 100vw;
}

#desktop {
  position: fixed;
  inset: 0;
  bottom: var(--taskbar-h);
  /* ══════════════════════════════════════════════════════
     FONDO POR DEFECTO DEL ESCRITORIO
     Este es el gradiente inicial. Cuando el usuario elija
     un fondo con imagen, se reemplaza por background-image.
  ══════════════════════════════════════════════════════ */
  background: linear-gradient(160deg, #0d2b6e 0%, #1a5abf 40%, #3a8fdd 70%, #7ec8f0 100%);
  background-size: cover;
  background-position: center;
  transition: background 0.6s ease;
}

/* ── Iconos del escritorio ── */
.desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 80px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 6px;
  transition: background 0.18s;
}
.desktop-icon:nth-child(1) { top: 30px; left: 30px; }
.desktop-icon:nth-child(2) { top: 130px; left: 30px; }

.desktop-icon:hover { background: rgba(100,160,255,0.28); }
.desktop-icon:active { background: rgba(100,160,255,0.45); }

.icon-img {
  font-size: 42px;
  filter: drop-shadow(0 2px 6px rgba(0,0,100,0.6));
  line-height: 1;
}

.desktop-icon span {
  font-size: 11.5px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,80,0.9), 0 0 8px rgba(0,0,0,0.7);
  text-align: center;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ════════════════════════════════════════════════════════
   VENTANAS — Efecto Aero Glass
════════════════════════════════════════════════════════ */
.window {
  position: fixed;
  min-width: 420px;
  max-width: 520px;
  border-radius: 10px 10px 8px 8px;
  box-shadow: var(--shadow-win);
  overflow: hidden;
  z-index: 100;
  border: 1px solid var(--aero-border);
  animation: windowOpen 0.22s cubic-bezier(.22,1,.36,1);
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.glass-window {
  background: linear-gradient(
    170deg,
    rgba(160, 200, 255, 0.22) 0%,
    rgba(80, 140, 230, 0.16) 40%,
    rgba(20,  70, 160, 0.28) 100%
  );
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

/* ── Barra de título ── */
.window-titlebar {
  height: var(--titlebar-h);
  background: linear-gradient(
    180deg,
    rgba(120,180,255,0.55) 0%,
    rgba(40,100,210,0.65) 55%,
    rgba(20, 70,170,0.75) 100%
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 10px;
  cursor: move;
  border-bottom: 1px solid rgba(150,200,255,0.4);
  /* brillo superior sutil */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.win-icon { font-size: 14px; }

.win-title {
  font-size: 12.5px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,80,0.7);
  letter-spacing: 0.02em;
}

/* ── Botones de ventana ── */
.titlebar-buttons { display: flex; gap: 3px; }

.tb-btn {
  width: 26px;
  height: 20px;
  border: 1px solid rgba(100,160,255,0.5);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(180,210,255,0.45) 0%, rgba(60,120,220,0.55) 100%);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.tb-btn:hover { background: linear-gradient(180deg, rgba(200,225,255,0.65) 0%, rgba(80,140,240,0.7) 100%); }
.tb-close { background: linear-gradient(180deg, rgba(255,100,100,0.6) 0%, rgba(200,30,30,0.75) 100%); }
.tb-close:hover { background: linear-gradient(180deg, rgba(255,140,140,0.8) 0%, rgba(220,50,50,0.9) 100%); }

/* ── Cuerpo de ventana ── */
.window-body {
  padding: 18px 20px 20px;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100,160,255,0.4) transparent;
}

.window-body::-webkit-scrollbar { width: 6px; }
.window-body::-webkit-scrollbar-thumb { background: rgba(100,160,255,0.4); border-radius: 3px; }

/* ── Cabecera de sección ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.section-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-shadow: 0 1px 4px rgba(0,0,80,0.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-icon { font-size: 16px; }

.separator {
  border: none;
  border-top: 1px solid rgba(150,200,255,0.25);
  margin: 18px 0;
}

/* ════════════════════════════════════════════════════════
   CONTROL DE VOLUMEN
════════════════════════════════════════════════════════ */
.volume-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  background: rgba(0,30,90,0.3);
  border: 1px solid rgba(100,170,255,0.25);
  border-radius: 8px;
  padding: 10px 14px;
}

.vol-label { font-size: 22px; min-width: 28px; text-align: center; }

#volume-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) var(--val, 60%), rgba(255,255,255,0.2) var(--val, 60%));
  outline: none;
  cursor: pointer;
}
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d0e8ff, #4a90e2);
  border: 1px solid rgba(80,140,255,0.8);
  box-shadow: 0 2px 6px rgba(0,0,80,0.5);
  cursor: pointer;
}
#volume-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(180deg, #d0e8ff, #4a90e2);
  border: 1px solid rgba(80,140,255,0.8);
  cursor: pointer;
}

.vol-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
  text-shadow: 0 0 8px rgba(90,163,245,0.5);
}

.vol-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Botón estilo Vista ── */
.vista-btn {
  background: linear-gradient(
    180deg,
    rgba(200,225,255,0.35) 0%,
    rgba(80,140,230,0.45) 50%,
    rgba(40,90,190,0.55) 100%
  );
  border: 1px solid rgba(120,180,255,0.55);
  border-radius: 5px;
  color: #e8f4ff;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 5px rgba(0,0,80,0.35);
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.vista-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(220,240,255,0.55) 0%,
    rgba(100,160,255,0.6) 50%,
    rgba(60,110,210,0.7) 100%
  );
  border-color: rgba(160,210,255,0.8);
}
.vista-btn:active { transform: translateY(1px); }

.mute-btn { background: linear-gradient(180deg, rgba(255,180,100,0.35) 0%, rgba(200,80,30,0.5) 100%); border-color: rgba(255,150,80,0.5); }
.mute-btn:hover { background: linear-gradient(180deg, rgba(255,200,130,0.5) 0%, rgba(220,100,50,0.65) 100%); }

/* ════════════════════════════════════════════════════════
   MINIATURAS DE FONDOS
════════════════════════════════════════════════════════ */
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.wp-thumb {
  position: relative;
  height: 72px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(0,0,50,0.45);
}
.wp-thumb:hover {
  border-color: rgba(160,210,255,0.8);
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0,0,100,0.5);
}
.wp-thumb.active-wp {
  border-color: #5ba3f5;
  box-shadow: 0 0 0 3px rgba(91,163,245,0.45), 0 6px 18px rgba(0,0,100,0.5);
}

.wp-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3px 5px;
  font-size: 10px;
  color: #fff;
  background: rgba(0,0,40,0.55);
  backdrop-filter: blur(4px);
  text-align: center;
  font-weight: 500;
}

/* ════════════════════════════════════════════════════════
   REPRODUCTOR / ARCHIVOS LOCALES
════════════════════════════════════════════════════════ */
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0,20,70,0.4);
  border: 1px solid rgba(100,160,255,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.np-art {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a3a8f, #4a7fd4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,80,0.5);
  border: 1px solid rgba(100,160,255,0.35);
  animation: none;
}
.np-art.playing { animation: spin-art 8s linear infinite; }

@keyframes spin-art {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.np-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.np-artist { font-size: 11.5px; color: var(--text-dim); }

.player-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.play-btn {
  background: linear-gradient(180deg, rgba(100,220,150,0.4) 0%, rgba(20,150,70,0.55) 100%);
  border-color: rgba(80,200,120,0.55);
}
.play-btn:hover {
  background: linear-gradient(180deg, rgba(130,240,170,0.55) 0%, rgba(40,170,90,0.7) 100%);
}
.play-btn.paused {
  background: linear-gradient(180deg, rgba(255,200,80,0.4) 0%, rgba(200,130,0,0.55) 100%);
  border-color: rgba(255,180,60,0.55);
}

.progress-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

#progress-bar {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
}
#progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d0e8ff, #4a90e2);
  border: 1px solid rgba(80,140,255,0.8);
  box-shadow: 0 2px 6px rgba(0,0,80,0.4);
}

.time-label { font-size: 11px; color: var(--text-dim); min-width: 34px; text-align: center; }

/* ── Lista de música ── */
.music-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100,160,255,0.4) transparent;
}
.music-list::-webkit-scrollbar { width: 5px; }
.music-list::-webkit-scrollbar-thumb { background: rgba(100,160,255,0.4); border-radius: 3px; }

.music-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  background: rgba(0,20,70,0.2);
}
.music-file:hover {
  background: rgba(60,120,220,0.3);
  border-color: rgba(100,170,255,0.35);
}
.music-file.active-track {
  background: rgba(40,100,200,0.4);
  border-color: rgba(91,163,245,0.55);
  box-shadow: inset 0 0 12px rgba(91,163,245,0.15);
}

.mf-icon { font-size: 20px; flex-shrink: 0; }
.mf-info { flex: 1; overflow: hidden; }
.mf-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mf-artist { font-size: 11px; color: var(--text-dim); }
.mf-play-hint { font-size: 13px; color: rgba(150,200,255,0.5); flex-shrink: 0; }
.music-file.active-track .mf-play-hint { color: #5ba3f5; }

/* ════════════════════════════════════════════════════════
   BARRA DE TAREAS
════════════════════════════════════════════════════════ */
#taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--taskbar-h);
  background: linear-gradient(
    180deg,
    rgba(60,110,210,0.6) 0%,
    rgba(20,60,160,0.75) 50%,
    rgba(10,40,130,0.85) 100%
  );
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid rgba(120,180,255,0.45);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  z-index: 999;
  box-shadow: 0 -2px 20px rgba(0,0,80,0.5);
}

/* ── Botón Inicio (orb) ── */
.start-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 40% 35%,
    #7ecfff 0%, #1a7fe8 45%, #0a3fa0 100%);
  box-shadow: 0 0 12px rgba(60,160,255,0.65), 0 3px 10px rgba(0,0,80,0.55),
              inset 0 1px 0 rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.start-btn:hover {
  box-shadow: 0 0 20px rgba(100,200,255,0.85), 0 3px 12px rgba(0,0,80,0.6),
              inset 0 1px 0 rgba(255,255,255,0.5);
}
.start-btn:active { transform: scale(0.92); }

.start-orb {
  width: 20px; height: 20px;
  background: radial-gradient(circle at 38% 32%, #fff 0%, #60b0ff 50%, #1050c0 100%);
  border-radius: 50%;
}

/* ── Items de taskbar (ventanas minimizadas) ── */
#taskbar-items { flex: 1; display: flex; gap: 4px; align-items: center; overflow: hidden; }

.taskbar-item {
  height: 30px;
  min-width: 110px;
  max-width: 180px;
  background: linear-gradient(180deg, rgba(160,200,255,0.25) 0%, rgba(40,90,190,0.4) 100%);
  border: 1px solid rgba(100,160,255,0.4);
  border-radius: 4px;
  color: #ddeeff;
  font-size: 11.5px;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  padding: 0 10px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.15s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.taskbar-item:hover { background: linear-gradient(180deg, rgba(200,225,255,0.4) 0%, rgba(70,130,220,0.55) 100%); }

/* ── Bandeja del sistema ── */
#taskbar-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  height: 100%;
  border-left: 1px solid rgba(100,160,255,0.25);
}

#tray-volume { font-size: 16px; cursor: pointer; }

#taskbar-clock {
  font-size: 11.5px;
  color: #cce8ff;
  font-weight: 500;
  min-width: 45px;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0,0,80,0.6);
}

/* ════════════════════════════════════════════════════════
   MENÚ INICIO
════════════════════════════════════════════════════════ */
#start-menu {
  position: fixed;
  bottom: var(--taskbar-h);
  left: 4px;
  width: 220px;
  background: linear-gradient(
    160deg,
    rgba(180,215,255,0.2) 0%,
    rgba(40,90,200,0.35) 100%
  );
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(120,180,255,0.5);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 4px -4px 30px rgba(0,0,80,0.55);
  animation: menuSlide 0.18s ease;
}

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.start-user {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, rgba(30,90,210,0.5), transparent);
  border-bottom: 1px solid rgba(100,160,255,0.3);
  text-shadow: 0 1px 6px rgba(0,0,80,0.7);
}

.start-items { padding: 6px 0; }

.start-item {
  padding: 9px 18px;
  font-size: 12.5px;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: background 0.15s;
}
.start-item:hover { background: rgba(80,140,255,0.35); }
