/* Estilos generales y reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

/* Variables CSS para optimización y consistencia */
:root {
    --primary-green: #0f0;
    --primary-green-glow: rgba(0, 255, 0, 0.7);
    --background-black: #000;
    --terminal-font: 'Courier New', monospace;
    --border-radius: 8px;
    --icon-size: 70px;
    --icon-height: 80px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --shadow-glow: 0 0 10px var(--primary-green-glow);
}

body, html {
    height: 100%;
    width: 100%;
    background-color: var(--background-black);
    background-image: none;
    color: var(--primary-green);
    overflow: hidden;
    position: relative;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Modo de rendimiento - desactivar animaciones costosas */
.performance-mode {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    animation-fill-mode: forwards !important;
}

.performance-mode *,
.performance-mode *:before,
.performance-mode *:after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0.1s !important;
    transition-delay: 0s !important;
}

/* Desactivar efectos de filtro pesados en modo rendimiento */
.performance-mode .desktop-icon .icon-image {
    filter: none !important;
}

.performance-mode .terminal-output {
    animation: none !important;
    text-shadow: 1px 1px 2px rgba(0, 255, 0, 0.3) !important;
}

/* ==== BIOS Screen Styles ==== */
#bios-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    z-index: 8997;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#bios-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #ddd;
}

.bios-company {
    font-weight: bold;
    color: #fff;
}

.bios-version {
    color: #aaa;
}

#bios-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bios-section {
    margin-bottom: 15px;
}

.bios-section-header {
    color: #fff;
    border-bottom: 1px solid #444;
    padding-bottom: 2px;
    margin-bottom: 6px;
}

.bios-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.bios-item-name {
    color: #bbb;
    margin-right: 20px;
}

.bios-item-value {
    color: #fff;
    font-weight: bold;
}

.bios-progress {
    color: #0f0;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    text-align: center;
    flex-direction: column;
}

.bios-progress div {
    margin: 5px 0;
}

.bios-ram-test {
    margin-top: 20px;
    color: #0f0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#memory-status {
    font-weight: bold;
    color: #0f0;
    margin: 8px 0 15px;
}

.energy-star-logo {
    display: none; /* Ya no usamos este selector directamente */
}

/* Estilos para los logos ASCII */
.boot-ascii-art {
    font-family: monospace;
    font-size: 0.8rem;
    margin: 15px auto;
    text-align: center;
    white-space: pre;
    line-height: 1.2;
    font-weight: bold;
}

/* Logo Energy Star (azul) */
#boot-ascii-container .energy-star {
    color: #4c9ed9;
    text-shadow: 0 0 10px #4c9ed9;
    animation: energy-glow 2s infinite alternate;
}

/* Logo Intel Inside (azul) */
#boot-ascii-container .intel {
    color: #0071c5;
    text-shadow: 0 0 10px #0071c5;
    animation: intel-glow 2s infinite alternate;
}

/* Logo AMD (rojo) */
#boot-ascii-container .amd {
    color: #ED1C24;
    text-shadow: 0 0 10px #ED1C24;
    animation: amd-glow 2s infinite alternate;
}

/* Logo NVIDIA (verde) */
#boot-ascii-container .nvidia {
    color: #76B900;
    text-shadow: 0 0 10px #76B900;
    animation: nvidia-glow 2s infinite alternate;
}

/* Logo Tux Linux (blanco/amarillo) */
#boot-ascii-container .tux {
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700;
    animation: tux-glow 2s infinite alternate;
}

/* Logo BIOS (blanco) */
#boot-ascii-container .bios {
    color: #FFFFFF;
    text-shadow: 0 0 10px #FFFFFF;
    animation: bios-glow 2s infinite alternate;
}

@keyframes energy-glow {
    from { text-shadow: 0 0 5px #4c9ed9, 0 0 10px #4c9ed9; }
    to { text-shadow: 0 0 10px #4c9ed9, 0 0 20px #4c9ed9, 0 0 30px #4c9ed9; }
}

@keyframes intel-glow {
    from { text-shadow: 0 0 5px #0071c5, 0 0 10px #0071c5; }
    to { text-shadow: 0 0 10px #0071c5, 0 0 20px #0071c5, 0 0 30px #0071c5; }
}

@keyframes amd-glow {
    from { text-shadow: 0 0 5px #ED1C24, 0 0 10px #ED1C24; }
    to { text-shadow: 0 0 10px #ED1C24, 0 0 20px #ED1C24, 0 0 30px #ED1C24; }
}

@keyframes nvidia-glow {
    from { text-shadow: 0 0 5px #76B900, 0 0 10px #76B900; }
    to { text-shadow: 0 0 10px #76B900, 0 0 20px #76B900, 0 0 30px #76B900; }
}

@keyframes tux-glow {
    from { text-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700; }
    to { text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700, 0 0 30px #FFD700; }
}

@keyframes bios-glow {
    from { text-shadow: 0 0 5px #FFFFFF, 0 0 10px #FFFFFF; }
    to { text-shadow: 0 0 10px #FFFFFF, 0 0 20px #FFFFFF, 0 0 30px #FFFFFF; }
}

.bios-memory-block {
    display: none; /* Ya no necesitamos mostrar los bloques de memoria */
}

.bios-footer {
    position: absolute;
    bottom: 20px;
    width: calc(100% - 40px);
    color: #999;
    display: flex;
    justify-content: space-between;
}

.bios-keys {
    display: flex;
}

.bios-key {
    background-color: #333;
    color: #fff;
    padding: 2px 8px;
    margin-right: 10px;
    border-radius: 3px;
    font-size: 12px;
}

.bios-action {
    color: #aaa;
    margin-left: 5px;
}

/* ==== Boot Overlay Styles ==== */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #00000000;
    color: #0f0;
    display: flex; /* Use flex to center content */
    justify-content: center;
    align-items: center;
    z-index: 8900;
    font-family: 'Courier New', monospace;
    opacity: 1;
    transition: opacity 1s ease-out; /* Fade out transition */
}

#boot-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Disable interaction after fade */
}

#boot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 800px;
}

#boot-logo {
    text-align: center;
    margin-bottom: 30px;
    white-space: pre; /* Preserve ASCII art formatting */
    font-size: 0.8rem; /* Adjust size of ASCII art */
    line-height: 1.1;
}

#boot-logo span {
    display: block;
    margin-top: 10px;
    font-size: 1rem;
    color: #ccc;
}

#progress-bar-container {
    width: 100%;
    height: 10px;
    border: 1px solid #0f0;
    margin-bottom: 20px;
    background-color: #111;
}

#progress-bar {
    width: 0%; /* Start at 0 */
    height: 100%;
    background-color: #0f0;
    transition: width 0.3s linear; /* Smooth progress animation */
}

#boot-messages {
    width: 100%;
    height: 200px; /* Fixed height for scrolling effect */
    overflow-y: hidden; /* Hide scrollbar, manage scroll via JS */
    border: 1px dashed rgba(0, 255, 0, 0.3);
    padding: 10px;
    font-size: 0.75rem;
    line-height: 1.3;
    background-color: rgba(0, 10, 0, 0.2);
    white-space: pre-wrap;
    word-break: break-all;
}

#boot-messages div {
    margin-bottom: 2px;
}

/* Ensure container and windows start hidden */
.container,
#terminal-window,
#gui-menu-window {
    display: none; /* Overwrite potential inline styles during boot */
}

/* Modify body background *after* boot if desired */
body.boot-complete {
    background-color: #010101; /* Restore slightly lighter black */
    background-image: url('wallpaper2.webp'); /* Usar wallpaper2.webp como fondo */
    background-size:auto; /* poner imagen en el centro */
    background-position: center;
    background-repeat: no-repeat;
}

/* Contenedor principal */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    padding-bottom: 40px; /* Espacio para la barra de tareas */
}

/* Terminal */
.terminal {
    width: 80%;
    height: 70vh; /* Added height */
    background-color: rgba(0, 0, 0, 0.85); /* Slightly more opaque */
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5),
                0 0 40px rgba(0, 255, 0, 0.2);
    overflow: hidden; /* Ensure children don't overflow rounded corners */
    animation: terminal-glow 3s infinite alternate; /* Keep glow */
    position: absolute; /* Added for dragging */
    top: 15vh; /* Initial position */
    left: 10%; /* Initial position */
    display: flex; /* Added for flex layout */
    flex-direction: column; /* Stack header and body vertically */
    min-width: 300px; /* Minimum dimensions */
    min-height: 150px;
    transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease; /* Smooth transitions */
    z-index: 500; /* Keep initial base z-index */
}

/* Maximized state */
.terminal.maximized {
    width: 100% !important; /* Use !important to override inline styles */
    height: calc(100% - 40px) !important; /* Restamos la altura de la barra de tareas */
    top: 0 !important;
    left: 0 !important;
    border-radius: 0; /* Optional: remove border radius when maximized */
    max-width: none; /* Remove max-width constraint */
}

/* Minimized state */
.terminal.minimized {
    display: none !important; /* Ocultamos completamente las ventanas minimizadas */
}

.terminal.minimized .terminal-body,
.terminal.minimized .resizer {
    display: none; /* Hide body and resizer when minimized */
}

/* Style for when dragging */
.terminal.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

@keyframes terminal-glow {
    0% {
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.5),
                    0 0 20px rgba(0, 255, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.7),
                    0 0 40px rgba(0, 255, 0, 0.4),
                    0 0 60px rgba(0, 255, 0, 0.2);
    }
}

/* Cabecera de la terminal */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #222;
    padding: 8px 10px;
    border-bottom: 1px solid #333;
    cursor: move; /* Indicate draggable */
    flex-shrink: 0; /* Prevent header from shrinking */
    position: relative; /* Needed for absolute positioning of buttons if required */
    user-select: none; /* Prevent text selection in header */
    touch-action: none;
}

.terminal-buttons {
    display: flex;
    gap: 6px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer; /* Indicate buttons are clickable */
}

.close {
    background-color: #ff5f56;
}

.minimize {
    background-color: #ffbd2e;
}

.maximize {
    background-color: #27c93f;
}

.terminal-title {
    color: #aaa;
    font-size: 0.8rem;
}

/* Cuerpo de la terminal */
.terminal-body {
    padding: 10px; /* Reduced padding */
    overflow: hidden; /* Hide scrollbar explicitly */
    background-color: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(0, 255, 0, 0.3);
    flex-grow: 1; /* Allow body to fill available space */
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack output and input vertically */
}

/* Output area */
#terminal-output {
    flex-grow: 1; /* Allow output to take most space */
    overflow: hidden; /* Ensure no internal scrollbar */
    margin-bottom: 10px; /* Space before input line */
}

.terminal-line {
    margin: 2px 0; /* Reduced margin */
    color: #0f0;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    white-space: pre-wrap; /* Allow wrapping */
    word-break: break-all; /* Break long words */
}

/* Input line container */
.terminal-input-line {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent input line from shrinking */
}

.prompt {
    color: #0f0;
    margin-right: 8px;
    white-space: nowrap; /* Prevent prompt from wrapping */
}

/* Input field */
.terminal-input {
    flex-grow: 1;
    background: none;
    border: none;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    outline: none;
    padding: 2px 0; /* Minimal padding */
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.success {
    color: #0f0;
    font-weight: bold;
    margin-top: 10px;
    animation: blink 0.5s linear 3;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Efecto de tipeo */
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    width: 0;
    animation: typing 2s steps(30, end) forwards;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* Cursor parpadeante (now used for input focus potentially) */
.blinking-cursor {
    display: inline-block;
    width: 10px;
    height: 1em; /* Use em for height */
    background-color: #0f0;
    animation: blink-cursor 1s infinite;
    margin-left: 2px; /* Adjusted margin */
    vertical-align: text-bottom; /* Align better with text */
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Título glitch */
.glitch-container {
    width: 100%;
    text-align: center;
    margin: 20px 0; /* Adjusted margin */
}

.glitch {
    color: #0f0;
    font-size: 3rem; /* Adjusted size */
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 0 10px #0f0;
    letter-spacing: 8px; /* Adjusted spacing */
    animation: glitch-animation 3s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #0000ff, 2px 2px #ff00c1;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
    }
    20% {
        clip: rect(12px, 9999px, 59px, 0);
    }
    40% {
        clip: rect(96px, 9999px, 4px, 0);
    }
    60% {
        clip: rect(67px, 9999px, 11px, 0);
    }
    80% {
        clip: rect(58px, 9999px, 11px, 0);
    }
    100% {
        clip: rect(40px, 9999px, 16px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(5px, 9999px, 99px, 0);
    }
    20% {
        clip: rect(5px, 9999px, 42px, 0);
    }
    40% {
        clip: rect(94px, 9999px, 33px, 0);
    }
    60% {
        clip: rect(67px, 9999px, 47px, 0);
    }
    80% {
        clip: rect(26px, 9999px, 13px, 0);
    }
    100% {
        clip: rect(67px, 9999px, 36px, 0);
    }
}

/* Estilos para el contenido de las secciones (now hidden) */
.content-section {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 4px;
    animation: fade-in 0.5s;
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Resizer handle */
.resizer {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: transparent; /* Make it invisible */
    cursor: nwse-resize; /* Diagonal resize cursor */
    border-bottom-right-radius: 6px; /* Match terminal corner */
    z-index: 10; /* Ensure it's above body content */
}

/* Adjust resizer visibility when maximized */
.terminal.maximized .resizer {
    display: none;
}

/* Icono de Escritorio */
.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    z-index: 100;
    margin-bottom: 45px; /* Aseguramos que el último icono no se solape con la barra */
    width: 70px;   /* Dimensiones consistentes para grid alignment */
    height: 80px;  /* Altura para acomodar icono + label */
    justify-content: center;
}

.desktop-icon .icon-image {
    font-size: 3rem; /* Restored larger size */
    filter: drop-shadow(0 0 5px rgba(0, 255, 0, 0.7));
    flex-shrink: 0;
}

.desktop-icon .icon-label {
    font-size: 12px;  /* Aumentado de 10px a 12px para mejor legibilidad */
    color: white;
    text-align: center;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    flex-shrink: 0;
}

/* Icons positioned dynamically by DesktopManager - no hardcoded positions needed */

.desktop-icon:hover {
    background-color: rgba(0, 255, 0, 0.1);
}

/* Ventana GUI */
.gui-window {
    position: absolute;
    top: 20vh;
    left: 15%;
    width: 60%;
    height: 50vh;
    min-width: 400px;
    min-height: 300px;
    background-color: rgba(10, 20, 10, 0.9); /* Slightly different background */
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important for resizer */
    z-index: 500; /* Keep initial base z-index */
    transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease; /* Smooth transitions */
}

/* Maximized state for GUI */
.gui-window.maximized {
    width: 100% !important;
    height: calc(100% - 40px) !important; /* Respeta la barra de tareas */
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
    max-width: none;
}

/* Minimized state for GUI */
.gui-window.minimized {
    display: none !important; /* Ocultamos completamente las ventanas minimizadas */
}

.gui-window.minimized .gui-body,
.gui-window.minimized .resizer {
    display: none; /* Hide body and resizer when minimized */
}

.gui-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a2a2a; /* Darker header */
    padding: 6px 10px;
    border-bottom: 1px solid #444;
    cursor: move;
    flex-shrink: 0;
    user-select: none; /* Prevent text selection */
    touch-action: none;
}

.gui-buttons {
    display: flex;
    gap: 6px;
}

/* Reuse terminal button styles */
.gui-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}
.gui-buttons .close { background-color: #ff5f56; }
.gui-buttons .minimize { background-color: #ffbd2e; } /* Style for new buttons */
.gui-buttons .maximize { background-color: #27c93f; } /* Style for new buttons */

.gui-title {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: bold;
}

.gui-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden; /* Prevent internal scrollbars if not needed */
    padding: 10px;
    gap: 10px; /* Space between sidebar and content */
}

.gui-sidebar {
    width: 200px; /* Fixed width sidebar */
    flex-shrink: 0;
    border-right: 1px solid rgba(0, 255, 0, 0.2);
    padding-right: 10px;
    overflow-y: auto; /* Scroll if items exceed height */
    color: #0f0;
}

.gui-item, .gui-folder {
    padding: 5px 8px;
    margin-bottom: 3px;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s ease;
}

.gui-item:hover, .gui-folder:hover {
    background-color: rgba(0, 255, 0, 0.15);
}

.gui-item.selected, .gui-folder.selected {
     background-color: rgba(0, 255, 0, 0.3);
     font-weight: bold;
}

.gui-content-display {
    flex-grow: 1;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto; /* Scroll content if it's long */
    color: #0f0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap; /* Preserve formatting */
    border: 1px solid rgba(0, 255, 0, 0.1);
}

/* Reuse resizer style for GUI window */
.gui-window .resizer {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    z-index: 10;
}

/* Ensure draggable class works for GUI window */
.gui-window.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

/* ==== Settings Window Styles ==== */
.settings-window {
    position: absolute;
    top: 25vh;
    left: 20%;
    width: 450px; /* Adjusted width */
    height: auto; /* Auto height based on content */
    min-width: 350px;
    min-height: 200px;
    background-color: rgba(15, 15, 25, 0.92); /* Slightly different background */
    border: 1px solid rgba(100, 100, 255, 0.4); /* Bluish border */
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(100, 100, 255, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 502; /* Ensure it can be above others */
    transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease;
    color: #ccc; /* Default text color */
}

/* Maximized state for Settings */
.settings-window.maximized {
    width: 100% !important;
    height: calc(100% - 40px) !important; /* Respeta la barra de tareas */
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
    max-width: none;
}

/* Minimized state for Settings */
.settings-window.minimized {
    display: none !important; /* Ocultamos completamente las ventanas minimizadas */
}

.settings-window.minimized .settings-body,
.settings-window.minimized .resizer {
    display: none;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #252535; /* Darker bluish header */
    padding: 6px 10px;
    border-bottom: 1px solid #404050;
    cursor: move;
    flex-shrink: 0;
    user-select: none;
    touch-action: none;
}

.settings-buttons {
    display: flex;
    gap: 6px;
}

/* Reuse terminal button styles */
.settings-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}
.settings-buttons .close { background-color: #ff5f56; }
.settings-buttons .minimize { background-color: #ffbd2e; }
.settings-buttons .maximize { background-color: #27c93f; }

.settings-title {
    color: #ddd;
    font-size: 0.9rem;
    font-weight: bold;
}

.settings-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto; /* Allow scrolling if content exceeds height */
    background-color: rgba(10, 10, 15, 0.8);
}

.settings-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(100, 100, 255, 0.2);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3 {
    color: #0f0; /* Green headers for sections */
    margin-bottom: 10px;
    font-size: 1rem;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
}

.settings-body label {
    display: block; /* Each label on a new line */
    margin-bottom: 8px;
    cursor: pointer;
    color: #bbb;
    transition: color 0.2s ease;
}

.settings-body label:hover {
    color: #fff;
}

.settings-body input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
    /* Optional: Style checkboxes */
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid #0f0;
    border-radius: 2px;
    background-color: rgba(0, 255, 0, 0.1);
    cursor: pointer;
    position: relative;
    top: -1px; /* Align better */
}

.settings-body input[type="checkbox"]:checked {
    background-color: #0f0;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.settings-body input[type="checkbox"]:checked::after {
    content: '\2713'; /* Checkmark */
    font-size: 12px;
    color: #000; /* Black checkmark */
    position: absolute;
    top: -2px;
    left: 1px;
    font-weight: bold;
}

/* Reset button styles */
.reset-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: 2px solid #ff8787;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.reset-button:hover {
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    border-color: #ff9999;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
    transform: translateY(-1px);
}

.reset-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.setting-description {
    font-size: 11px;
    color: #0a8;
    margin: 0;
    font-style: italic;
    line-height: 1.3;
}

/* Reuse resizer style for Settings window */
.settings-window .resizer {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    z-index: 10;
}

/* Ensure draggable class works for Settings window */
.settings-window.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

/* Position Settings icon */
#settings-icon {
    position: absolute;
    top: 270px; /* Position below Minesweeper icon */
    left: 30px;
    z-index: 100;
}

/* Apply opening animation */
.window-opening {
    animation: window-open 0.4s ease-out forwards;
}

/* Barra de tareas */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-top: 1px solid rgba(0, 255, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    backdrop-filter: blur(5px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

#taskbar-items {
    display: flex;
    gap: 5px;
    height: 100%;
    align-items: center;
    justify-content: flex-start;
    max-width: 80%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 0, 0.4) rgba(0, 0, 0, 0.3);
    padding: 0 10px;
}

.taskbar-item {
    height: 30px;
    min-width: 120px;
    max-width: 180px;
    background-color: rgba(0, 20, 0, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    color: #0f0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    user-select: none;
}

.taskbar-item:hover {
    background-color: rgba(0, 40, 0, 0.9);
    border-color: rgba(0, 255, 0, 0.6);
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.taskbar-item.active {
    background-color: rgba(0, 60, 0, 0.9);
    border-color: rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.7);
}

.taskbar-item-icon {
    margin-right: 5px;
    font-size: 16px;
}

/* Estilos para el botón de inicio */
#start-button {
    display: flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    margin-right: 10px;
    background-color: rgba(0, 40, 0, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 4px;
    color: #0f0;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

#start-button:hover {
    background-color: rgba(0, 60, 0, 0.9);
    border-color: rgba(0, 255, 0, 0.7);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

#start-button.active {
    background-color: rgba(0, 80, 0, 0.9);
    border-color: rgba(0, 255, 0, 0.8);
    box-shadow: inset 0 0 8px rgba(0, 255, 0, 0.5);
}

.start-button-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url('logo_calimocho.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Eliminamos el marcador de posición ya que ahora usamos la imagen */
.calimocho-placeholder {
    display: none;
}

.start-button-text {
    font-size: 14px;
    font-weight: bold;
}

/* Estilos para el menú de inicio */
.start-menu {
    position: fixed;
    bottom: 42px; /* Justo encima de la barra de tareas */
    left: 5px;
    width: 250px;
    background-color: rgba(10, 20, 10, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.5);
    border-radius: 8px 8px 0 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 255, 0, 0.5);
    overflow: hidden;
    backdrop-filter: blur(5px);
    z-index: 1001;
    transform-origin: bottom left;
    transform: scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.start-menu.active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

.start-menu-header {
    padding: 12px 15px;
    background-color: rgba(0, 50, 0, 0.9);
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    color: #0f0;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.start-menu-content {
    padding: 10px 0;
    max-height: 400px;
    overflow-y: auto;
}

.start-menu-section {
    padding: 5px;
}

.start-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.start-menu-item:hover {
    background-color: rgba(0, 255, 0, 0.15);
}

.start-menu-icon {
    font-size: 18px;
    margin-right: 10px;
    width: 25px;
    text-align: center;
}

.start-menu-text {
    color: #ddd;
    font-size: 14px;
}

.start-menu-divider {
    height: 1px;
    background-color: rgba(0, 255, 0, 0.2);
    margin: 8px 0;
}

/* ===== Menú Contextual ===== */
.context-menu {
    position: absolute;
    display: none;
    min-width: 200px;
    background-color: #2f3136;
    border: 1px solid #1a1b1e;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 4px 0;
    z-index: 1000;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    color: #dcddde;
    animation: contextMenuFadeIn 0.15s ease;
    overflow: visible;
}

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

.context-menu-item {
    padding: 6px 24px 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    white-space: nowrap;
}

.context-menu-item:hover {
    background-color: #5865f2;
    color: white;
}

.context-menu-icon {
    margin-right: 8px;
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.context-menu-text {
    flex-grow: 1;
}

.context-menu-arrow {
    position: absolute;
    right: 8px;
    font-size: 0.7em;
}

.context-menu-separator {
    height: 1px;
    background-color: #3a3c42;
    margin: 4px 0;
}

.context-submenu {
    position: absolute;
    left: 100%;
    top: -4px;
    min-width: 150px;
    background-color: #2f3136;
    border: 1px solid #1a1b1e;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.context-menu-item:hover > .context-submenu {
    opacity: 1;
    visibility: visible;
}

/* Ajustes para móviles */
@media (max-width: 768px), (pointer: coarse) {
    /* Iconos del escritorio ajustados para móviles */
    .desktop-icon {
        width: 70px;   /* Mantener consistencia con escritorio */
        height: 80px;  /* Mantener consistencia con escritorio */
        margin: 10px;  /* Menos margen para aprovechar espacio */
        z-index: 101;
    }
    
    .desktop-icon .icon-image {
        font-size: 2.5rem; /* Ligeramente más pequeño en móvil */
    }
    
    .desktop-icon .icon-label {
        font-size: 11px;  /* Ligeramente más pequeño en móvil pero legible */
        margin-top: 5px;
    }
    
    /* Icons positioned dynamically by DesktopManager on all screen sizes */
    
    /* Hacer la barra de tareas más grande */
    #taskbar {
        height: 50px;
        padding: 5px 10px;
    }
    
    #start-button {
        width: auto;
        min-width: 45px;
        height: 40px;
        font-size: 16px;
        display: flex;
        align-items: center;
        padding: 0 10px;
    }
    
    .start-button-image {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }
    
    .taskbar-item {
        height: 40px;
        font-size: 16px;
        padding: 0 15px;
        margin-left: 10px;
    }
    
    /* Ajustar tamaño de ventanas */
    .window-buttons .close, 
    .window-buttons .minimize, 
    .window-buttons .maximize {
        width: 18px;
        height: 18px;
        margin-left: 8px;
    }
    
    /* Hacer que las ventanas sean arrastradas con dos dedos (para evitar confusión con scroll) */
    .terminal-header, .gui-header, .minesweeper-header, .settings-header, .tetris-header, .puzzlebubble-header {
        touch-action: none;
    }

 
    /* Hacer el resizer más grande para facilitar el redimensionamiento */
    .resizer {
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Estilos para pantallas muy pequeñas */
    @media (max-width: 480px) {
        /* Ajustar el menú inicio para pantallas pequeñas */
        #start-menu {
            width: 200px;
            left: 5px;
        }
        
        .start-menu-item {
            font-size: 14px;
            padding: 10px;
        }
        
        /* Hacer el botón de inicio más compacto */
        #start-button .start-button-text {
            display: none; /* Ocultar el texto "Inicio" */
        }
        
        #start-button {
            width: 45px;
            min-width: 0;
            padding: 0;
            justify-content: center;
        }
        
        .start-button-image {
            margin-right: 0;
        }
    }
}

/* Added animation for terminal closing */
@keyframes terminal-off {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
        visibility: hidden;
    }
}

/* Added animation for window opening */
@keyframes window-open {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    70% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

