@font-face {
    font-family: 'FallingSky'; /* Nombre que usaremos en CSS */
    src: url('../fonts/FallingSky-JKwK.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body { 
	font-family: 'FallingSky', sans-serif;
	overflow: hidden;
}

#taskbar { 
	position: absolute; 
	bottom: 0; 
	width: 100%; 
	height: 40px; 
	background: rgba(0,0,0,0.8); 
	display: flex; 
	align-items: center; 
	color: white; 
}

.window {
    background: #1e1e1e !important; /* Gris muy oscuro casi negro */
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}
.header {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
}
.win-btn:hover { background: #333; }
.win-close:hover { background: #c42b1c !important; color: white; }

.hidden { display: none; }

#desktop-icons {
    position: relative;
    width: 100vw;
    height: 100vh;
    touch-action: none; /* Crucial para arrastre en móviles y web */
    user-select: none;
}

.desktop-icon {
    position: absolute; /* Esto es obligatorio */
    width: 80px;
    height: 90px;
    cursor: move;
    touch-action: none;
    user-select: none;
    /* Transición para que el imán se vea profesional */
    transition: left 0.2s ease, top 0.2s ease;
}
/* Animación de deslizamiento */
#login-screen {
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 1000;
}
.login-up { transform: translateY(-100%); }

/* Estilo Barra de Tareas (Basado en tu imagen) */
.taskbar {
    background: rgba(32, 32, 32, 0.85); /* Estilo Windows 11 */
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
#start-menu {
    background: rgba(32, 32, 32, 0.9); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#start-menu.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* Estilo base del botón en la taskbar */
.taskbar-item {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre icono y texto */
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    background: transparent;
    color: white;
}

/* Hover suave */
.taskbar-item:hover { background: rgba(255, 255, 255, 0.1); }

/* Cuando la app está activa (añadiremos esta clase con JS) */
.taskbar-item.active {
    background: rgba(255, 255, 255, 0.15);
    position: relative;
}

/* La línea azul debajo */
.taskbar-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 25%;
    right: 25%;
    height: 3px;
    background: #3b82f6; /* Color azul */
    border-radius: 2px;
}

#desktop-icons { user-select: none; }

body {
    cursor: url('/assets/cursors/cursor.png'), auto;
}

/* Cursor para cuando pasas sobre botones o elementos clickeables */
button, a, .cursor-pointer {
    cursor: url('/assets/cursors/clicker.png'), pointer;
}

.desktop-icon-container {
    cursor: pointer;
}

.desktop-icon-container.is-dragging {
    cursor: move !important;
}

.alert-window {
    position: fixed;
    z-index: 9999;
    background: #f7f7f7;
    border: 1px solid #71a9da; /* Borde azul claro clásico */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    width: 380px;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: #000;
    padding: 1px; /* Para simular el borde de ventana */
}

.alert-header {
    background: linear-gradient(to bottom, #dbeaf9 0%, #a7cbf2 100%);
    padding: 4px 8px;
    color: #123e6f;
    font-size: 13px;
    font-weight: 600;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

/* El botón X clásico */
.alert-close-btn {
    background: #dbeaf9;
    border: 1px solid #71a9da;
    font-size: 10px;
    padding: 0px 6px;
    cursor: pointer;
}

.alert-content {
    padding: 20px 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.alert-icon { font-size: 35px; }

.alert-footer {
    padding: 10px;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    text-align: right;
}

.alert-footer button {
    background: #e1e1e1;
    border: 1px solid #767676;
    padding: 4px 20px;
    font-size: 13px;
}

.window {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.window.minimized {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.window.dragging {
    transition: none !important;
}

@keyframes window-appear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.window.appearing {
    animation: window-appear 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes window-fade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.window.appearing { animation: window-fade 0.2s ease-out forwards; }
.window.closing { animation: window-fade 0.2s ease-in reverse forwards; }

.window.maximized { 
    top: 0 !important; left: 0 !important; 
    width: 100vw !important; height: 100vh !important; 
    transform: translate(0, 0) !important; 
}

.app-indicator {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 3px;
    background: #3b82f6; /* Color azul estilo Windows 11 */
    border-radius: 2px;
    transition: width 0.2s ease;
}

/* Cuando está minimizada, el indicador es más pequeño */
.app-minimized-indicator {
    width: 3px;
    background: #6b7280; /* Color gris si está minimizada */
}

.icon-closing {
    animation: icon-exit-down 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
    overflow: hidden;
}

.icon-opening {
    animation: icon-enter-up 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Entrada: De abajo hacia arriba */
@keyframes icon-enter-up {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Salida: De arriba hacia abajo (Inversa exacta) */
@keyframes icon-exit-down {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(40px) scale(0.3); /* Coherente con el 0.5 de entrada */
        margin: 0;
        width: 0;
        height: 0;
    }
}

#desktop, #lock-screen, #login-screen {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.click-animation {
	transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.click-animation:active {
	transform: scale(0.9); /* Se reduce al 90% */
}

/* 1. Anchura de la barra (El "carril") */
::-webkit-scrollbar {
    width: 10px;        /* Grosor vertical */
    height: 10px;       /* Grosor horizontal */
}

/* 2. El fondo de la barra (Track) */
::-webkit-scrollbar-track {
    background: #0a0a0a; 
}

/* 3. La "manija" que mueves (Thumb) */
::-webkit-scrollbar-thumb {
    background: #333333; /* Color gris oscuro */
    border-radius: 5px;  /* Bordes redondeados tipo Windows */
    border: 2px solid #0a0a0a; /* Crea el efecto de margen, igual que en Windows */
}

/* 4. Efecto al pasar el mouse (Hover) */
::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a; /* Un gris un poco más claro al tocarlo */
}

/* 5. Efecto al hacer clic (Active) */
::-webkit-scrollbar-thumb:active {
    background: #555555;
}

/* 1. Desactiva la selección en TODA la aplicación por defecto */
body, .wiki-container {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE 10+ */
    user-select: none;         /* Estándar */
    cursor: default;           /* Cambia el cursor a flecha normal */
}

input, textarea, select, 
[contenteditable="true"], 
#wiki-text {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

.taskbar-item {
    /* Desactiva animaciones de posición para no bloquear el arrastre */
    transition: background 0.2s, opacity 0.2s !important; 
    touch-action: none;
    user-select: none;
    will-change: transform;
}

.taskbar-item:active { cursor: grabbing; }



.window {
    position: absolute;
    display: flex;
    flex-direction: column;
    /* Esto es vital para que la ventana no se desborde */
    overflow: hidden; 
    /* Asegura que la ventana tenga un tamaño base si no se especifica */
    min-height: 100px; 
    min-width: 200px;
}

.header {
    flex-shrink: 0; /* La cabecera nunca cambia de tamaño */
}

.content {
    flex: 1; /* Ocupa el resto del espacio */
    overflow-y: auto; /* Scroll solo si es necesario */
    min-height: 0;   /* NECESARIO para que flex no fuerce el tamaño del contenido */
}