:root {
    --xp-blue: #003399;
    --xp-light-blue: #5a7edc;
}

* {
    box-sizing: border-box;
    user-select: none;
}

body, html {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #ccc;
    font-family: "Lucida Console", Monaco, monospace;
    height: 100vh;
    overflow: hidden;
}

/* BIOS SECTION */
#bios-screen {
    padding: 40px;
    display: block;
    font-size: 20px;
}
.energy-star {
    float: right;
    color: #ffff00;
    text-align: center;
    border: 2px solid #ffff00;
    padding: 5px;
    font-size: 20px;
}

/* BOOT LOGO SECTION */
#logo-screen {
    display: none;
    height: 100vh;
    background-color: #000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    opacity: 0;
    transition: opacity 1.5s ease-in;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.logo-container img {
    width: 80vw;
    max-width: 600px;
    height: auto;
}

.xp-flag {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    position: relative;
}

/* Windows XP Flag Recreation */
.flag-part {
    position: absolute;
    border-radius: 8px;
}

.flag-red {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    top: 0;
    left: 0;
    border-radius: 12px 0 0 0;
}

.flag-green {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7fba00 0%, #b8d432 100%);
    bottom: 0;
    left: 0;
    border-radius: 0 0 0 12px;
}

.flag-blue {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00a4ef 0%, #4cc2f1 100%);
    top: 0;
    right: 0;
    border-radius: 0 12px 0 0;
}

.flag-yellow {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ffb900 0%, #ffd83d 100%);
    bottom: 0;
    right: 0;
    border-radius: 0 0 12px 0;
}

.xp-text {
    text-align: center;
    color: #fff;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.xp-text .microsoft {
    font-size: 18px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.xp-text .windows {
    font-size: 64px;
    font-weight: normal;
    letter-spacing: -2px;
    margin: 0;
    line-height: 1;
}

.xp-text .professional {
    font-size: 32px;
    font-weight: normal;
    letter-spacing: 3px;
    margin-top: 8px;
}

/* Enhanced Progress Bar */
#progress-container {
    width: 50%;
    max-width: 250px;
    width: 30%;
    min-width: 150px;
    height: 25px;
    border: 1px solid #d4d4d4;
    border-radius: 7px;
    position: relative;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    opacity: 0.70;
}

#progress-blocks {
    display: flex;
    position: absolute;
    left: -60px;
    height: 100%;
    align-items: center;
}

.block {
    width: 12px;
    height: 20px;
    margin: 0 2px;
    background: linear-gradient(to bottom, #4a9eff 0%, #1e5bc6 50%, #0d3d8f 100%);
    border-radius: 2px;
    box-shadow: 0 0 3px rgba(74, 158, 255, 0.6);
}

/* Boot Footer Image */
.boot-footer {
    position: absolute;
    bottom: 30px;
    left: 50%;
    width: auto;
    max-width: 90%;
    transform: translateX(-50%);
}

/* WELCOME SCREEN */
#login-screen {
    display: none;
    height: 100vh;
    width: 100vw;
    font-family: "Tahoma", "Segoe UI", sans-serif;
    flex-direction: column;
    overflow: hidden;
}

/* Top Blue Bar */
.top-bar {
    height: 12%;
    background-color: #003399; /* Deep XP Blue */
    border-bottom: 2px solid #ffffff33;
}

/* Middle Gradient Section */
.middle-section {
    flex-grow: 1;
    /* Authentic XP Welcome Gradient */
    background: linear-gradient(to bottom, #5a7edc 0%, #4a66cc 50%, #2f49aa 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Subtle Soft Glow in top left */
.middle-section::before {
    content: "";
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.welcome-container {
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.welcome-text {
    font-family: "Tahoma", sans-serif;
    font-size: 50px;
    font-style: italic;
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
}

.loading-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
}

/* The Small Square Loader Icon */
.loader-icon {
    width: 16px;
    height: 16px;
    border: 1px solid white;
    margin-right: 10px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
}

/* Bottom Blue Bar */
.bottom-bar {
    height: 12%;
    background-color: #003399;
    border-top: 2px solid #f8a900; /* Iconic Orange Divider */
    display: flex;
    align-items: center;
    padding: 0 40px;
}

/* Classic XP Turn Off Computer Button */
.turn-off {
    color: white;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.turn-off-icon {
    width: 22px;
    height: 22px;
    background-color: #cc3300;
    border: 1px solid white;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Loading Spinner */
.spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0.70;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    #bios-screen {
        padding: 15px;
        font-size: 14px;
    }

    .energy-star {
        font-size: 12px;
        padding: 2px;
    }

    .login-panel {
        flex-direction: column;
        height: auto;
    }

    .panel-left {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.3);
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
        align-items: center;
        text-align: center;
    }

    .panel-right {
        padding-left: 0;
        align-items: center;
    }
}

/* DESKTOP SCREEN */
#desktop-screen {
    display: none;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: "Tahoma", "Verdana", sans-serif;
    background: url('background.jpg') no-repeat center center fixed; 
    background-size: cover;
    cursor: progress;
}

.desktop-icons {
    display: block;
    position: relative;
    height: 90vh;
    padding: 10px;
}

.icon {
    width: 75px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    position: absolute;
}

.desktop-icons .icon:nth-child(1) { top: 10px; left: 10px; }
.desktop-icons .icon:nth-child(2) { top: 100px; left: 10px; }
.desktop-icons .icon:nth-child(3) { top: 190px; left: 10px; }
.desktop-icons .icon:nth-child(4) { top: 280px; left: 10px; }
.desktop-icons .icon:nth-child(5) { top: 370px; left: 10px; }
.desktop-icons .icon:nth-child(6) { top: 460px; left: 10px; }
.desktop-icons .icon:nth-child(7) { top: 10px; left: 100px; }
.desktop-icons .icon:nth-child(8) { top: 100px; left: 100px; }

.icon:hover {
    background-color: rgba(11, 97, 255, 0.2);
    border: 1px solid rgba(11, 97, 255, 0.4);
    border-radius: 3px;
}

.icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
}

.icon span {
    color: white;
    font-size: 14px;
    text-shadow: 1px 1px 1px #000;
    line-height: 1.2;
}

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, #245DDA 0%, #306EFF 4%, #1841A8 100%);
    border-top: 1px solid #4881FF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

.start-btn {
    height: 40px;
    width: 140px;
    background: radial-gradient(circle at top left, #5B9F42, #38761D); 
    border-radius: 0 10px 10px 0;
    box-shadow: inset 0px 2px 2px rgba(255,255,255,0.4), 2px 0px 5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    padding-left: 10px;
    cursor: pointer;
    margin-right: 5px;
    position: relative;
    top: 0;
}

.start-btn:hover {
     background: radial-gradient(circle at top left, #6CBB4E, #38761D); 
}

.start-logo {
    width: 28px;
    height: 28px;
    margin-right: 5px;
    background-image: url('windowsxplogo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.start-text {
    font-family: "Tahoma", sans-serif;
    font-weight: bold;
    font-style: italic;
    color: white;
    font-size: 24px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.task-items {
    flex-grow: 1;
    display: flex;
    padding-left: 10px;
    overflow: hidden;
}

.task-button {
    width: 160px;
    max-width: 160px;
    height: 40px;
    background: #3c81f3;
    border: 1px solid #16438e;
    border-radius: 3px;
    margin-right: 2px;
    display: flex;
    align-items: center;
    padding: 0 5px;
    cursor: pointer;
    color: white;
    font-family: "Tahoma", sans-serif;
    font-size: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.task-button:hover {
    background: #53a3ff;
}

.task-button.active {
    background: #1e52b7;
    box-shadow: inset 2px 2px 2px rgba(0,0,0,0.3);
}

.task-button img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.tray {
    height: 40px;
    background: #0B76BA;
    border-left: 1px solid #104685;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.2);
    padding: 0 15px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tray-icon {
    width: 20px;
    height: 20px;
}

.clock {
    color: white;
    font-size: 14px;
    text-shadow: 0px 1px 0px rgba(0,0,0,0.3);
    margin-left: 5px;
}

/* START MENU */
#start-menu {
    display: none;
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 380px;
    background: #1048A4;
    border-radius: 6px 6px 0 0;
    box-shadow: 2px 2px 12px rgba(0,0,0,0.4);
    border: 1px solid #00309C;
    overflow: hidden;
    z-index: 2000;
    flex-direction: column;
    font-family: "Tahoma", sans-serif;
}

.xp-header {
    background: linear-gradient(to bottom, #1868D8 0%, #0E56BA 100%);
    padding: 7px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #E59138;
}

.user-pic {
    width: 42px;
    height: 42px;
    border: 2px solid #fff;
    border-radius: 4px;
    background: url('https://i.imgur.com/uCjS864.png') no-repeat center/cover;
    margin-right: 10px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.user-name {
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 1px #000;
}

.xp-content {
    display: flex;
    background-color: white;
}

/* Left Column */
.left-col {
    width: 190px;
    background: white;
    padding: 4px 0;
}

.item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #000;
}

.item:hover {
    background-color: #2F71CD;
    color: white;
}

.item img {
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

.item-text span {
    color: #777;
    font-size: 10px;
}

.item:hover .item-text span {
    color: #eee;
}

.separator-left {
    height: 1px;
    background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0));
    margin: 5px 10px;
}

.all-programs {
    border-top: 1px solid #ccc;
    margin-top: 10px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #000;
}

.all-programs:hover { background: #2F71CD; color: white; }
.all-programs .arrow { color: #23A323; margin-left: 8px; font-size: 18px; }

/* Right Column */
.right-col {
    width: 190px;
    background: #D3E5FA;
    border-left: 1px solid #91B2E6;
    padding: 4px 0;
}

.item-r {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 11px;
    font-size: 14px;
    color: #00309C;
    cursor: pointer;
}

.item-r:hover { background-color: #2F71CD; color: white; }

.item-r img {
    width: 22px;
    height: 22px;
    margin-right: 8px;
}

.separator-right {
    height: 1px;
    background-color: #91B2E6;
    margin: 4px 10px;
}

/* Footer */
.xp-footer {
    background: linear-gradient(to bottom, #1868D8 0%, #0E56BA 100%);
    padding: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.footer-btn {
    display: flex;
    align-items: center;
    color: white;
    font-size: 11px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.footer-btn img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.footer-btn u { text-decoration: underline; }

/* Fix for start menu items click */
.item-text strong {
    font-weight: bold;
}

/* WINDOW STYLES */
.window {
    position: absolute;
    width: 400px;
    height: 300px;
    z-index: 1000;
}

.window .title-bar {
    background: linear-gradient(to bottom, #8CAEE5 0%, #9DB4F0 10%, #8CAEE5 100%);
}

.window.active .title-bar {
    background: linear-gradient(to bottom, #0058E6 0%, #3A93FF 10%, #0058E6 100%);
}

@media (max-width: 760px) {
    .desktop-icons .icon:nth-child(n) {
        left: 8px;
    }

    .desktop-icons .icon:nth-child(1) { top: 8px; }
    .desktop-icons .icon:nth-child(2) { top: 88px; }
    .desktop-icons .icon:nth-child(3) { top: 168px; }
    .desktop-icons .icon:nth-child(4) { top: 248px; }
    .desktop-icons .icon:nth-child(5) { top: 328px; }
    .desktop-icons .icon:nth-child(6) { top: 408px; }
    .desktop-icons .icon:nth-child(7) { top: 8px; left: 92px; }
    .desktop-icons .icon:nth-child(8) { top: 88px; left: 92px; }

    #start-menu {
        width: min(380px, 100vw);
    }

    .start-btn {
        width: 118px;
    }

    .start-text {
        font-size: 21px;
    }
}
