/* ==========================================================================
   theme-xp.css — Tema "Clásico XP" (html.theme-xp).
   Autocontenido: declara el juego completo de tokens con valores XP y los
   estilos propios del tema (biseles y barra de título).
   Sin fuentes externas, sin imágenes externas, sin backdrop-filter.

   Contrato de marcado de ventana (lo genera js/wm.js):
     <div class="window">
       <div class="titlebar">
         <span class="titlebar-text">Título</span>
         <div class="titlebar-buttons">
           <button class="titlebar-button minimize" aria-label="Minimizar"></button>
           <button class="titlebar-button maximize" aria-label="Maximizar"></button>
           <button class="titlebar-button close" aria-label="Cerrar"></button>
         </div>
       </div>
       ...
     </div>
   Ventana inactiva: .window.inactive .titlebar
   ========================================================================== */

/* 1. Tokens: juego completo con valores XP --------------------------------- */
.theme-xp {
  --font-ui: "TahomaLocal", Tahoma, "Trebuchet MS", sans-serif;
  --font-size: 12px;
  --text: #1a1a1a;
  --text-inverse: #fff;
  --bg-desktop: #3a6ea5;
  --window-bg: #ece9d8;
  --window-text: #1a1a1a;
  --window-border: #0831d9;
  --titlebar-bg: linear-gradient(180deg, #0058e6, #3a93ff);
  --titlebar-text: #fff;
  --titlebar-active-bg: linear-gradient(180deg, #0058e6, #3a93ff);
  --titlebar-inactive-bg: linear-gradient(180deg, #7f97c9, #aebfdd);
  --taskbar-bg: linear-gradient(180deg, #245edb, #1941a5);
  --taskbar-border: #0e2f8f;
  --taskbar-text: #fff;
  --start-bg: linear-gradient(180deg, #3c9d3c, #2f7d2f);
  --start-text: #fff;
  --accent: #316ac5;
  --accent-text: #fff;
  --menu-bg: #fff;
  --menu-border: #aca899;
  --selection-bg: rgba(49, 106, 197, .55);
  --bevel-light: #fff;
  --bevel-dark: #9a9a8e;
  --shadow-window: 4px 4px 12px rgba(0, 0, 0, .4);
  --icon-label-shadow: 1px 1px 1px rgba(0, 0, 0, .75);
  --radius: 3px;
  --control-h: 22px;
  --taskbar-h: 32px;
}

/* 2. Biseles XP reutilizables ----------------------------------------------
   .bevel-out: luz arriba/izquierda, oscuro abajo/derecha (elemento saliente).
   .bevel-in:  inverso (elemento hundido). */
.theme-xp .bevel-out {
  box-shadow: inset 1px 1px 0 var(--bevel-light),
              inset -1px -1px 0 var(--bevel-dark);
}

.theme-xp .bevel-in {
  box-shadow: inset 1px 1px 0 var(--bevel-dark),
              inset -1px -1px 0 var(--bevel-light);
}

/* 3. Barra de título XP ---------------------------------------------------- */
.theme-xp .titlebar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 4px 4px 8px;
  color: var(--titlebar-text);
  background: var(--titlebar-active-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); /* brillo superior */
  user-select: none;
}

.theme-xp .window.inactive .titlebar {
  background: var(--titlebar-inactive-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.theme-xp .titlebar-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .5); /* sombra de 1px */
}

/* Botones cuadrados 21x21 con bisel */
.theme-xp .titlebar-buttons {
  display: flex;
  gap: 2px;
}

.theme-xp .titlebar-button {
  position: relative;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 2px;
  background: linear-gradient(180deg, #6f9ae9, #3b6ad2 50%, #2f5ec4);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .35),
              inset -1px -1px 0 rgba(0, 0, 0, .25); /* bisel saliente */
}

.theme-xp .titlebar-button:hover {
  filter: brightness(1.08);
}

.theme-xp .titlebar-button:active {
  filter: brightness(.92);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .3),
              inset -1px -1px 0 rgba(255, 255, 255, .3); /* bisel hundido */
}

.theme-xp .titlebar-button.close {
  background: linear-gradient(180deg, #efae98, #d66a4d 50%, #c4563b);
}

/* Símbolos dibujados con CSS (blancos, con sombra de 1px) */

/* Minimizar: barra inferior */
.theme-xp .titlebar-button.minimize::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  height: 2px;
  background: #fff;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .3);
}

/* Maximizar: caja */
.theme-xp .titlebar-button.maximize::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  bottom: 4px;
  left: 5px;
  border: 1px solid #fff;
  border-top-width: 2px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .3);
}

/* Cerrar: aspa con dos líneas rotadas */
.theme-xp .titlebar-button.close::before,
.theme-xp .titlebar-button.close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: #fff;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .3);
}

.theme-xp .titlebar-button.close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.theme-xp .titlebar-button.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
