/* Variables para facilitar el cambio de temas */
:root {
    --win10-blue: #0078d4;
    --taskbar-bg: rgba(0, 0, 0, 0.75);
    --terminal-bg: #0c0c0c;
    --terminal-text: #cccccc;
    --start-menu-bg: rgba(0, 0, 0, 0.9);
    --window-bg: #f3f3f3;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden; 
}

/* --- ESTILO DEL ESCRITORIO --- */
#desktop {
    width: 100vw;
    height: 100vh;
    /* Cambia la imagen de fondo si es necesario */
    background-image: url('fondo_win10.jpg'); 
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 5px; 
    box-sizing: border-box;
    /* Configuración Grid para apilar los iconos verticalmente */
    display: grid; 
    grid-template-columns: min-content; 
    gap: 5px; /* Pequeño espacio entre los iconos/filas */
    margin-top: 0; 
    justify-content: start; 
    
    /* FIX: Fuerza a que el contenido (los iconos) se apile al principio */
    align-content: start; 
}

/* --- ESTILO DE LOS ICONOS DEL ESCRITORIO --- */
.desktop-icon {
    display: block; /* Para que ocupe su propia celda en el grid */
    text-decoration: none; /* Quita el subrayado de los enlaces */
    color: white;
    text-align: center;
    width: 70px; /* Ancho fijo para el icono */
    user-select: none; /* Evita selección de texto */
    cursor: default;
}

.desktop-icon img {
    display: block;
    margin: 0 auto 3px;
    image-rendering: pixelated; /* Mejor para iconos retro */
}

.desktop-icon span {
    display: block;
    font-size: 11px;
    word-wrap: break-word;
    /* El borde de texto ayuda a la visibilidad sobre fondos complejos */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); 
}

/* El elemento interno es el que tiene el efecto de hover */
.desktop-icon .inner-content {
    padding: 5px;
    border: 1px solid transparent; /* Borde transparente por defecto */
    transition: background-color 0.1s, border 0.1s;
    border-radius: 2px;
}

.desktop-icon .inner-content:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Gris claro semitransparente */
    border: 1px solid rgba(255, 255, 255, 0.25); /* Borde gris claro */
    box-sizing: border-box; 
    cursor: pointer; 
}

/* --- ESTILO DE LA BARRA DE TAREAS (Taskbar) --- */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 40px;
    background-color: var(--taskbar-bg);
    display: flex;
    align-items: center;
    padding: 0 5px;
    box-sizing: border-box;
    z-index: 1000;
}

#start-button {
    background-color: transparent;
    border: none;
    height: 40px;
    width: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.1s;
}

#start-button img {
    filter: invert(1);
}

#start-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#start-button.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.taskbar-icon {
    height: 40px;
    width: 48px;
    display: flex; /* Ahora siempre es flex para centrar */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.1s;
    margin: 0 1px;
}

.taskbar-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.taskbar-icon.active-app {
    border-bottom: 2px solid var(--win10-blue);
    background-color: rgba(255, 255, 255, 0.15);
}

#taskbar-center {
    flex-grow: 1; /* Rellena el espacio central */
}

#system-tray {
    padding: 0 10px;
    display: flex;
    align-items: center;
    color: white;
    font-size: 13px;
    height: 100%;
}

/* --- ESTILO DEL MENÚ DE INICIO (Start Menu) --- */
#start-menu {
    position: fixed;
    bottom: 40px; /* Justo encima de la taskbar */
    left: 0;
    width: 400px;
    height: calc(100vh - 40px);
    background-color: var(--start-menu-bg);
    z-index: 999;
    color: white;
    display: flex;
}

.start-menu-panel {
    width: 50px; /* Panel lateral izquierdo (botones de usuario, power) */
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    padding: 5px 0;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
}

.start-menu-apps {
    flex-grow: 1; /* Panel principal de aplicaciones */
    padding: 10px;
}

.start-menu-user, .start-menu-link {
    width: 100%;
    padding: 10px 5px;
    box-sizing: border-box;
    text-align: left;
    display: flex;
    align-items: center;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    color: white;
}

.start-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.start-menu-user img, .start-menu-link img {
    margin-right: 10px;
    filter: invert(1);
}

.start-menu-controls button {
    background: none;
    border: none;
    padding: 10px 5px;
    cursor: pointer;
    transition: background-color 0.1s;
}
.start-menu-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.start-menu-controls img {
    filter: invert(1);
}


/* --- ESTILO DE VENTANAS (General) --- */
.window {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 600px;
    height: 400px;
    background-color: var(--window-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    resize: both;
    overflow: auto;
    z-index: 998; /* Debajo de start-menu y taskbar */
}

.window.maximized {
    width: 100vw !important;
    height: calc(100vh - 40px) !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
    resize: none;
}

.window-header {
    height: 30px;
    background-color: var(--win10-blue);
    color: white;
    padding: 0 5px 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.window-title {
    font-size: 13px;
    font-weight: 600;
    color: white;
}
.window-controls button {
    background: none;
    border: none;
    font-size: 16px;
    height: 30px;
    width: 40px;
    cursor: pointer;
    color: white;
    transition: background-color 0.1s;
}
.window-controls .minimize-btn, .window-controls .maximize-btn {
    color: white;
}
.window-controls .close-btn:hover {
    background-color: #e81123;
    color: white;
}

.window-content {
    padding: 10px;
    height: calc(100% - 30px); /* Resta la altura del header */
    overflow: auto;
    box-sizing: border-box;
}

/* ESTILO ESPECÍFICO DE LA TERMINAL */
#terminal-window {
    background-color: var(--terminal-bg);
    border: 1px solid var(--terminal-bg);
    min-width: 400px;
    min-height: 200px;
}
#terminal-window .window-header { background-color: var(--terminal-bg); border-bottom: 1px solid #333; color: white; }
#terminal-window .window-title { color: white; }
#terminal-window .window-controls button { color: white; }
#terminal-window .window-controls button:hover { background-color: #333; }

/* ESTILO ESPECÍFICO DE DOOM */
#doom-window {
    min-width: 640px;
    min-height: 480px;
}

/* NUEVO ESTILO ESPECÍFICO DE PYTHON SCRIPTS (Opcional, si quieres un color de barra diferente) */
/* #python-window .window-header { background-color: #3572A5; } */
/* #python-window .window-title { color: white; } */
/* #python-window .window-controls button { color: white; } */