/* Boot Screen Styles */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(var(--real-vh, 1vh) * 100);
    min-height: 100dvh;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

/* Loading Container */
.loading-container {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.windows-logo {
    margin-bottom: 0px; /* Sin margen para pegar la barra al logo */
}

.windows-logo img {
    width: 450px; /* Aumentar el tamaño del logo considerablemente */
    height: auto;
    object-fit: contain;
    margin-bottom: 30px; /* Ajustar el margen inferior de la imagen del logo */
    filter: drop-shadow(0 0 30px rgba(255,255,255,0.4));
    animation: xp-boot-logo 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes xp-boot-logo {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.windows-logo h1 {
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 80px; /* Ajustar tamaño de fuente del título principal */
    margin: 0;
    font-weight: normal;
    letter-spacing: 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.7);
}

.windows-logo h1 .xp {
    color: #FF6B35;
    font-size: 55px; /* Ajustar tamaño de fuente del "XP" */
    vertical-align: super;
    margin-left: -5px;
    font-weight: bold;
}

.tagline {
    color: #ddd;
    font-size: 18px;
    font-family: 'Arial', sans-serif;
    margin-top: 5px; /* Reducir el margen superior del tagline */
    letter-spacing: 0;
    text-transform: capitalize;
}

/* Loading Bar - Windows XP Style */
.loading-bar-container {
    width: 300px;
    height: 20px;
    margin: 0 auto;
    border: 2px solid #868686;
    border-radius: 4px;
    background: #000;
    padding: 2px;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    animation: xp-boot-bar 0.42s 0.18s ease-out both;
}

@keyframes xp-boot-bar {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-bar-container::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    animation: xp-loading-glint 1.8s linear infinite;
    pointer-events: none;
}

.loading-bar {
    height: 100%;
    display: flex;
    gap: 2px; /* Keep existing gap */
    padding: 0 2px; /* Keep existing padding */
    justify-content: flex-start; /* New: Align blocks to the start */
    overflow: hidden; /* New: Hide overflowing content */
}

.loading-block {
    width: 15px; /* Modified: Fixed width for square appearance */
    height: 100%;
    background: #316AC5;
    opacity: 1; /* Modified: Always visible */
    animation: xp-loading-slide 2s linear infinite; /* Modified: New animation */
}

@keyframes xp-loading-slide {
    0% {
        transform: translateX(-100%); /* Start off-screen to the left */
    }
    100% {
        transform: translateX(calc(300px + 100%)); /* Move across the 300px container + its own width */
    }
}

@keyframes xp-loading-glint {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Apply animation delays to each block using nth-child selectors */
.loading-block:nth-child(1) {
    animation-delay: 0s;
}
.loading-block:nth-child(2) {
    animation-delay: 0.2s; /* Adjust delay for chasing effect */
}
.loading-block:nth-child(3) {
    animation-delay: 0.4s; /* Adjust delay for chasing effect */
}

/* Boot Footer */
.boot-bottom-left {
    position: absolute;
    bottom: 30px; /* Ajustar la posición del texto inferior izquierdo */
    left: 30px;
    color: #b9b9b9;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.boot-skip {
    position: absolute;
    left: 50%;
    bottom: 28px;
    z-index: 2;
    min-height: 32px;
    padding: 6px 16px;
    transform: translateX(-50%);
    border: 1px solid #8aa8d8;
    border-radius: 3px;
    background: linear-gradient(#ffffff, #dce8f8);
    box-shadow: inset 1px 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.55);
    color: #08235d;
    font: 12px Tahoma, sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.boot-skip:hover,
.boot-skip:focus-visible {
    border-color: #f3b33d;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.boot-skip:active {
    transform: translateX(-50%) translateY(1px);
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.35);
}

@media (max-width: 600px) {
    .boot-skip {
        bottom: 82px;
    }
}

.boot-bottom-left span {
    display: block;
}

.boot-bottom-right {
    position: absolute;
    bottom: 30px; /* Ajustar la posición del texto inferior derecho */
    right: 30px;
    color: #fff;
    font-family: 'Arial', sans-serif;
}

.boot-wordmark {
    font-size: 36px;
    font-weight: bold;
    font-style: italic;
    opacity: 0.8;
    animation: xp-wordmark-enter 0.55s 0.2s ease-out both;
}

@keyframes xp-wordmark-enter {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 0.8; transform: translateX(0); }
}

/* Boot Fadeout Overlay */
.boot-fadeout-overlay-style {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9998;
    transition: opacity 0.5s;
}

/* Login Screen Styles */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(var(--real-vh, 1vh) * 100);
    min-height: 100dvh;
    z-index: 9997;
    overflow: hidden;
}

.login-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.login-screen-initial-display {
    opacity: 1;
    transition: opacity 0.5s;
}

.login-screen-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Pattern overlay - more subtle */
.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 15px 15px;
    pointer-events: none;
}

/* Gradient overlay */
.login-screen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent 0%, rgba(15, 59, 217, 0.3) 100%);
    pointer-events: none;
}

.login-screen-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    padding: 0 80px 80px 80px; /* Ajustar el padding inferior para subir un poco más el contenido central */
    gap: 50px; /* Espacio entre el logo y el perfil de usuario */
    z-index: 1;
    position: relative;
    animation: xp-login-stage 0.48s var(--xp-ease-out) both;
}

@keyframes xp-login-stage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px; /* Reducir aún más el espacio entre logo y texto */
}

.custom-logo {
    width: 280px; /* Reducir aún más el tamaño del logo */
    height: auto;
    margin: 0;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    animation: xp-login-logo 0.55s 0.08s var(--xp-ease-out) both;
}

@keyframes xp-login-logo {
    from { opacity: 0; transform: translateX(-14px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.left-text {
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    max-width: 500px;
    margin-top: 10px; /* Añadir un pequeño margen superior para separar del logo */
    text-align: center; /* Asegurar centrado */
}

.login-instruction-name {
    font-weight: bold;
}

.brand-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    margin: 0;
    text-align: left;
}

.login-brand h1 {
    font-family: 'Tahoma', sans-serif;
    font-size: 72px;
    color: white;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0;
}

.login-brand .xp-text {
    color: #FF6B35;
    font-weight: bold;
    font-style: italic;
    font-size: 84px;
}

.brand-subtitle {
    font-family: 'Tahoma', sans-serif;
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.login-separator {
    display: none;
}

.right {
    cursor: pointer;
    /* Eliminamos el posicionamiento absoluto para que flexbox lo maneje */
    animation: xp-login-user 0.55s 0.14s var(--xp-ease-out) both;
}

@keyframes xp-login-user {
    from { opacity: 0; transform: translateX(14px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.back-gradient {
    min-width: 292px;
    background: linear-gradient(90deg, rgba(8, 73, 168, 0.92), rgba(28, 105, 207, 0.7));
    padding: 10px 18px 10px 10px;
    border: 1px solid rgba(220, 239, 255, 0.92);
    border-left: 5px solid #f4a52c;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition:
        background-color var(--xp-motion-window) var(--xp-ease-out),
        border-color var(--xp-motion-window) var(--xp-ease-out),
        box-shadow var(--xp-motion-window) var(--xp-ease-out),
        transform var(--xp-motion-window) var(--xp-ease-out);
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.36),
        inset -1px -1px 0 rgba(0,48,130,0.52),
        0 4px 14px rgba(0,37,103,0.28);
}

.back-gradient:hover {
    background: linear-gradient(90deg, rgba(18, 91, 194, 0.98), rgba(52, 132, 229, 0.82));
    border-color: #fff;
    border-left-color: #ffc45b;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.5),
        inset -1px -1px 0 rgba(0,48,130,0.58),
        0 7px 18px rgba(0,37,103,0.34);
    transform: translateY(-2px) scale(1.015);
}

.back-gradient:active {
    transform: translateY(0) scale(0.985);
}

.back-gradient:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.user img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    border: 2px solid #ffd27a;
    background: white;
    padding: 2px;
    box-shadow: 1px 2px 4px rgba(0, 32, 91, 0.46);
}

.text-wrap {
    min-width: 0;
    max-width: 430px;
    text-align: left;
}

.name {
    font-size: 16px;
    font-weight: bold;
    color: white;
    font-family: 'Tahoma', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 2px;
}

.user-title {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-family: 'Tahoma', sans-serif;
    line-height: 1.35;
}

/* Turn off section */
.turn-off {
    position: absolute;
    bottom: 15px; /* Mover más abajo */
    left: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
    opacity: 0.8;
    cursor: pointer;
}

.turn-off:hover {
    opacity: 1;
}

#shutdown-icon {
    width: 16px;
    height: 16px;
}

.shutdown-text {
    text-decoration: underline;
}

/* Right bottom text */
.right-bottom {
    position: absolute;
    bottom: 15px; /* Mover más abajo */
    right: 30px;
    color: white;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
    opacity: 0.9;
    text-align: right;
    line-height: 1.4;
}

.desktop-bottom-detail {
    display: block;
}

.mobile-bottom-detail {
    display: none;
}

/* Welcome Message */
.welcome-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 2;
}

.welcome-message-initial-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.welcome-image-fallback {
    font-size: 72px;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-weight: bold;
    font-style: italic;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    animation: xp-welcome-enter 0.46s var(--xp-ease-out) both;
}

@keyframes xp-welcome-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .login-screen-center,
    .custom-logo,
    .right,
    .welcome-image-fallback {
        animation: none !important;
        transition: none !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .login-screen-center {
        flex-direction: column;
        gap: 40px;
    }
    
    .login-separator {
        display: block;
        width: 200px;
        border: none;
        border-top: 1px solid rgba(255,255,255,0.3);
        margin: 20px 0;
    }
    
    .desktop-bottom-detail {
        display: none;
    }
    
    .mobile-bottom-detail {
        display: block;
    }
    
    .left-text {
        display: none;
    }
    
    .boot-wordmark {
        font-size: 24px;
    }
    
    .windows-logo h1 {
        font-size: 48px;
    }
    
    .windows-logo h1 .xp {
        font-size: 32px;
    }
}

/* Log off Dialog */
.logoff-dialog-hidden {
    display: none;
}

#logoff-dialog-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logoff-dialog {
    position: relative;
    display: inline-block;
}

.logoff-dialog-background {
    display: block;
    width: 400px;
    height: auto;
    max-width: 400px;
}

.logoff-dialog-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.logoff-dialog-header-text {
    color: white;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Tahoma', sans-serif;
    text-align: left;
    padding: 12px 12px 8px 12px;
    margin-top: 0;
}

.logoff-dialog-button-container {
    display: flex;
    gap: 60px;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px 0;
}

.logoff-dialog-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    background: transparent;
    border: 1px solid transparent;
    min-width: 100px;
}

.logoff-dialog-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.logoff-dialog-button img {
    width: 48px;
    height: 48px;
}

.logoff-dialog-button span {
    font-size: 12px;
    text-align: center;
    color: #000;
    font-family: 'Tahoma', sans-serif;
    font-weight: normal;
}

#logoff-cancel-btn {
    padding: 6px 20px;
    font-size: 11px;
    background: #E1E1E1;
    border: 1px solid #ADADAD;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    color: #000;
    margin: 0 20px 20px 0;
    align-self: flex-end;
}

#logoff-cancel-btn:hover {
    background: #EFEFEF;
    border-color: #0054E3;
}

/* Shutdown Window Styles */
.shutdown-window-hidden {
    display: none;
}

#shutdown-window-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shutdown-window {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shutdown-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Logoff Window Styles */
.logoff-window-hidden {
    display: none;
}

#logoff-window-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logoff-window {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logoff-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
