body {
    margin: 0;
    overflow: hidden;
    background-color: black; /* Set background to black */
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    min-height: 100vh; /* Ensure body takes full viewport height */
    flex-direction: column; /* Stack image and loading bar vertically */
    gap: 20px; /* Add space between the image and the loading bar */
    transition: background-color 1s ease-in-out; /* Smooth transition for background color */
}
img {
    max-width: 100%; /* Ensure image scales down if too wide */
    max-height: 100%; /* Ensure image scales down if too tall */
    display: block; /* Remove extra space below image */
}

.loading-bar-container {
    width: 300px; /* Width of the entire loading bar */
    height: 15px; /* Height of the loading bar */
    background-color: #333; /* Dark background for the bar track */
    border-radius: 7.5px; /* Half of height for rounded caps */
    overflow: hidden; /* Ensures the moving light stays within the bar */
    position: relative; /* Needed for positioning the pseudo-element */
}

.loading-bar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* The pseudo-element covers the bar initially */
    height: 100%;
    /* Gradient for the moving light effect */
    background: linear-gradient(to right,
                                transparent 0%,
                                rgba(255, 255, 255, 0.3) 30%, /* Light part of the gradient */
                                rgba(255, 255, 255, 0.3) 70%,
                                transparent 100%);
    background-size: 100% 100%; /* One full gradient segment fits container width */
    background-repeat: repeat-x; /* Repeat the gradient horizontally */
    animation: moveLight 1.5s infinite linear; /* Animation to move the gradient */
}

@keyframes moveLight {
    0% { background-position: 0 0; } /* Start the gradient at its initial position */
    100% { background-position: -100% 0; } /* Move the gradient by exactly one full segment width to create a seamless loop */
}

/* Styles for the new window (Windows 7 style) */
.window {
    display: none; /* Hidden by default */
    width: 900px; /* Increased size */
    height: 680px; /* Increased size */
    background-color: #002B4B; /* Changed to match body background */
    border: 4px solid #3B6EA5; /* Thicker border, Windows 7 blue */
    box-shadow: 0 4px 24px rgba(38, 77, 123, 0.25);
    border-radius: 8px;
    overflow: hidden;
    flex-direction: column; /* Organize title bar and content vertically */
    position: absolute; /* Position it absolutely within the body to overlay other content */
    color: #333; /* Default text color for the window, inherited by title bar */
    z-index: 10; /* Base z-index for normal windows */
}

.window-title-bar {
    background: linear-gradient(to bottom, #EBF3FB 0%, #D8EBF9 50%, #C4DEEE 100%); /* Windows 7 Aero-like gradient */
    padding: 8px 14px 8px 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    font-weight: bold;
    border-bottom: 1px solid #87B5E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
    position: relative;
    user-select: none;
    cursor: grab; /* Indicate draggable */
}

.window-title-text {
    flex: 1;
    color: #28518A;
    text-shadow: 0 1px 0 #fff, 0 -1px 0 #bacede; /* Subtle Windows 7 style */
}

.window-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

/* NEW: Windows 7 Minimize/Maximize/Close buttons */
.window-minimize-btn,
.window-maximize-btn,
.window-close-btn {
    width: 45px; /* Standard width for control buttons */
    height: 27px;
    border: none;
    background: linear-gradient(to bottom, #EFF6FC 0%, #DEEEFB 50%, #C9E1F7 100%); /* Windows 7 default button gradient */
    border-radius: 4px;
    margin-left: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 1px 1px rgba(128,128,128,0.08) inset, 0 1px 2px rgba(0,0,0,0.08);
    transition: background 0.15s;
}

.window-close-btn {
    background: linear-gradient(to bottom, #F8C5C4 0%, #F17073 100%); /* Red gradient for close */
    margin-right: -8px; /* Offset for standard close button positioning */
    width: 52px; /* Wider close button */
}

.window-minimize-btn:hover,
.window-maximize-btn:hover {
    background: linear-gradient(to bottom, #D2E7FB 0%, #BCD8F1 50%, #A2CEEA 100%); /* Lighter hover gradient */
}

.window-close-btn:hover {
    background: linear-gradient(to bottom, #FF5959 10%, #EA2727 100%);
}

.window-minimize-btn .icon,
.window-maximize-btn .icon,
.window-close-x {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #28518A; /* Dark blue text color */
    text-shadow: 0 1px 0 #fff, 0 0 2px #fff;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.window-close-x {
    color: #861A1C; /* Dark red for close button 'X' */
}

/* Specific icon styling for maximize/restore */
.window-maximize-btn .icon.restore { /* Icon for restore state */
    font-size: 10px; /* Smaller for overlapping squares */
    position: relative;
    display: block;
    width: 10px;
    height: 10px;
}
.window-maximize-btn .icon.restore::before,
.window-maximize-btn .icon.restore::after {
    content: '';
    display: block;
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1.5px solid #28518A;
}
.window-maximize-btn .icon.restore::before { /* Bottom-right square */
    top: 0;
    left: 0;
}
.window-maximize-btn .icon.restore::after { /* Top-left square */
    top: -3px;
    left: -3px;
    background-color: #C4DEEE; /* Fill color for the top square to hide intersection, matches bottom of title bar gradient */
}

.window-content {
    flex-grow: 1; /* Take up remaining space */
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    background-color: #002B4B; /* Changed to match body background */
    color: white; /* Changed for readability on dark background */
    display: flex;
    flex-direction: column; /* Stack items vertically */
    justify-content: flex-start; /* Align content to the top */
    align-items: center; /* Center content horizontally */
    padding-top: 50px; /* Add padding to push content down from the top edge */
    position: relative; /* ADDED: For absolute positioning of children like the "Install Now" button */
    padding-bottom: 70px; /* Give room for footer button now always at bottom */
}

.logo-text-container {
    display: flex;
    align-items: center; /* Vertically centers items within this container */
}

.language-selection-container {
    display: flex;
    align-items: center; /* Vertically align text and dropdown */
    margin-top: 70px; /* Space from the logo-text container */
}

.language-text {
    margin-right: 10px; /* Space between text and dropdown */
    /* Inherits font-family, font-size, color from .window-content */
}

.language-dropdown {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #5a5a5a;
    background-color: #333; /* Darker background for dropdown */
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    width: 150px; /* A fixed width for consistency */
    cursor: default; /* Indicate it's not interactive */
}

/* Styling for the disabled state of the dropdown */
.language-dropdown:disabled {
    opacity: 0.7;
    background-color: #444;
    color: #ccc;
}

.language-dropdown option {
    background-color: #333; /* Ensures options also have dark background */
    color: white;
}

/* Footer positioning for bottom-aligned Next button in window */
.window-footer-buttons {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    /* Change layout to STACK AT THE BOTTOM using absolute positioning */
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 24px 22px 24px; /* Proper padding on sides & bottom */
    margin-top: 0;
    background: none;
    z-index: 2;
    box-sizing: border-box;
    min-height: 48px;
}

/* Styles for the new "Next" button */
.window-next-btn {
    width: 75px; /* Standard width for a "Next" button */
    height: 27px;
    border: 1px solid #7DA2CE; /* Windows 7 default button border */
    background: linear-gradient(to bottom, #EFF6FC 0%, #DEEEFB 50%, #C9E1F7 100%); /* Windows 7 default button gradient */
    border-radius: 4px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #15428B; /* Dark blue text color */
    text-shadow: 0 1px 0 #fff; /* Subtle white text shadow */
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(128,128,128,0.08) inset, 0 1px 2px rgba(0,0,0,0.08);
    transition: background 0.15s, border-color 0.15s;
    margin: 0;
}

.window-next-btn:hover {
    background: linear-gradient(to bottom, #D2E7FB 0%, #BCD8F1 50%, #A2CEEA 100%); /* Lighter hover gradient */
    border-color: #6C8DBB; /* Darker border on hover */
}

/* Styles for the new "Install Now" button */
.install-now-btn {
    display: none; /* Hidden by default */
    position: absolute; /* Position absolutely within its relative parent */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for button's own size */
    padding: 12px 25px;
    background: linear-gradient(to bottom, #7B68EE 0%, #483D8B 100%); /* Blueish-purple gradient */
    border: 1px solid #3A3070;
    border-radius: 5px;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.install-now-btn:hover {
    background: linear-gradient(to bottom, #8B7EEC 0%, #584EB1 100%); /* Lighter on hover */
    border-color: #4A4080;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* New Taskbar styles */
.taskbar {
    position: fixed; /* Stays at the bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px; /* Standard taskbar height */
    background-color: rgba(0, 0, 0, 0.6); /* Black with 40% transparency (60% opacity) */
    display: none; /* Hidden by default */
    z-index: 1000; /* Ensure it's on top */
    /* Optional: Add a frosted glass effect */
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    display: flex; /* Use flexbox for internal layout */
    align-items: center; /* Vertically center items */
    padding: 0 10px; /* Padding on sides */
}

/* New Start button styles */
.start-button {
    width: 48px; /* Square button, same as taskbar height */
    height: 40px; /* Slightly less than taskbar height to allow for padding/shadows */
    background-color: transparent; /* No background by default */
    border: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 10px; /* Space between start button and other taskbar items */
    transition: background-color 0.2s ease-in-out, border-radius 0.2s ease-in-out;
    border-radius: 4px; /* Slight roundness for default state */
}

.start-button:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Light hover effect */
    border-radius: 8px; /* More rounded on hover */
}

.start-button:active {
    background-color: rgba(255, 255, 255, 0.25); /* Darker active effect */
    border-radius: 8px; /* Keep rounded */
}

.start-button-icon {
    width: 26px; /* Size of the Windows logo */
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0, 120, 212, 0.7)); /* Subtle glow for the logo */
}

/* Styles for new Recycle Bin icon */
.desktop-icon {
    position: absolute; /* Position relative to the body */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7); /* For readability on busy background */
    user-select: none; /* Prevent text selection */
    display: none; /* Hidden by default */
    width: 80px; /* A fixed width to center text */
}

/* Specific positioning for existing icons */
#recycle-bin-icon {
    top: 20px;
    left: 20px;
}

/* NEW: Specific positioning for Chrome icon */
#chrome-icon {
    top: 113px; /* 20px (Recycle Bin top) + 55px (img height) + 5px (img-text margin) + 13px (text height) + 20px (spacing) */
    left: 20px;
}

/* NEW: Specific positioning for Game Store icon */
#game-store-icon {
    top: 206px; /* 113px (Chrome top) + 55px (img height) + 5px (img-text margin) + 13px (text height) + 20px (spacing) */
    left: 20px;
}

/* NEW: Specific positioning for dynamically created Notepad icon */
#notepad-desktop-icon {
    top: 299px; /* This will be calculated in JS but set here as a default */
    left: 20px;
}

.desktop-icon img {
    width: 55px; /* Size of the icon image */
    height: 55px;
    margin-bottom: 5px; /* Space between image and text */
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)); /* Subtle shadow for the icon */
}

/* NEW: Windows 11 App Window Styles */
.win11-window {
    display: none; /* Hidden by default, will be shown via JS */
    width: 900px;
    height: 680px;
    background-color: #F3F3F3; /* Light grey for the app background */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Softer shadow */
    overflow: hidden;
    flex-direction: column;
    position: absolute;
    color: #333; /* Default text color */
    z-index: 10; /* Base z-index for normal windows */
}

.win11-title-bar {
    background-color: #F3F3F3; /* Matches window background */
    padding: 0; /* No padding, buttons span full height */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px; /* Smaller font */
    font-weight: normal;
    border-bottom: none; /* No border */
    display: flex;
    align-items: center;
    height: 32px; /* Thinner title bar */
    position: relative;
    user-select: none;
    flex-shrink: 0; /* Prevent it from shrinking */
    cursor: grab; /* Indicate draggable */
}

.win11-title-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #333;
    text-shadow: none;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
    max-width: calc(100% - 100px); /* Adjust based on button width (48px*2 = 96, so approx 100px) */
}

.win11-window-buttons {
    display: flex;
    align-items: center;
    gap: 0; /* Buttons are flush */
    height: 100%;
    margin-left: auto; /* Push buttons to the right */
}

/* NEW: Windows 11 Minimize/Maximize/Close buttons */
.win11-minimize-btn,
.win11-maximize-btn,
.win11-close-btn {
    width: 48px; /* Standard Win11 button width */
    height: 32px; /* Same height as title bar */
    border: none;
    background-color: transparent; /* Default transparent */
    border-radius: 0; /* No individual border radius */
    margin: 0; /* No margins */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease-in-out;
}

.win11-minimize-btn:hover,
.win11-maximize-btn:hover {
    background-color: rgba(0, 0, 0, 0.08); /* Light grey hover */
}

.win11-close-btn:hover {
    background-color: #e81123; /* Standard Windows 11 red hover */
}

.win11-minimize-btn .icon,
.win11-maximize-btn .icon,
.win11-close-x {
    font-family: 'Segoe UI Symbol', 'Segoe MDL2 Assets', 'Segoe UI', Arial, sans-serif; /* For symbols */
    font-size: 10px; /* Smaller symbols */
    font-weight: normal;
    color: #333; /* Dark icon by default */
    text-shadow: none;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    transition: color 0.15s ease-in-out; /* Smooth color transition */
}

.win11-close-btn:hover .win11-close-x {
    color: white; /* White 'X' on red hover */
}

/* Specific icon styling for Win11 maximize/restore */
.win11-maximize-btn .icon.restore {
    font-size: 10px;
    position: relative;
    display: block;
    width: 10px; /* Container size for the two squares */
    height: 10px;
    pointer-events: none;
}
.win11-maximize-btn .icon.restore::before,
.win11-maximize-btn .icon.restore::after {
    content: '';
    display: block;
    position: absolute;
    width: 7px;
    height: 7px;
    border: 1px solid #333;
}
.win11-maximize-btn .icon.restore::before { /* Bottom-right square */
    top: 0;
    left: 0;
}
.win11-maximize-btn .icon.restore::after { /* Top-left square */
    top: -3px;
    left: -3px;
    background-color: #F3F3F3; /* Match title bar background to hide intersection */
}

/* Updated: The main content area of the File Explorer window */
.file-explorer-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column; /* Stack toolbar and bottom panel */
    background-color: #F3F3F3; /* Light grey, matches win11-window */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #333;
    overflow: hidden; /* Ensure content stays within bounds */
}

/* File Explorer Toolbar */
.fe-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #F3F3F3;
    border-bottom: 1px solid #E0E0E0;
    flex-shrink: 0;
    gap: 8px; /* Space between groups of elements */
}

.fe-nav-buttons {
    display: flex;
    gap: 4px;
}

.fe-button {
    border: none;
    background-color: transparent;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    color: #333;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.fe-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.fe-icon-button {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    line-height: 1; /* Ensure icon is centered vertically */
}

/* For disabled buttons, e.g., if no back history */
.fe-button:disabled {
    opacity: 0.5;
    cursor: default;
    background-color: transparent;
}
.fe-button:disabled:hover {
    background-color: transparent;
}


.fe-address-search-container {
    flex-grow: 1;
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.fe-address-bar,
.fe-search-bar {
    display: flex;
    align-items: center;
    background-color: #EFEFEF;
    border-radius: 4px;
    padding: 4px 8px;
    border: 1px solid #E0E0E0;
    flex-grow: 1;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); /* Subtle inner shadow */
}

.fe-address-bar input,
.fe-search-bar input {
    border: none;
    outline: none;
    background: transparent;
    flex-grow: 1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    font-size: 13px;
    padding: 0 4px;
}

.fe-address-bar input:focus,
.fe-search-bar input:focus {
    box-shadow: 0 0 0 1px #0078D4; /* Blue focus outline */
    border-color: #0078D4;
}

.fe-icon-prefix,
.fe-icon-suffix {
    margin: 0 4px;
    color: #666;
    font-size: 16px;
}

/* File Explorer Bottom Panel (Sidebar + Content) */
.fe-bottom-panel {
    display: flex;
    flex-grow: 1;
    overflow: hidden; /* For scrolling content if needed */
}

.fe-sidebar {
    width: 250px;
    background-color: #F8F8F8; /* Lighter background for sidebar */
    border-right: 1px solid #E0E0E0;
    padding-top: 8px;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    overflow-y: auto; /* Allow scrolling for many items */
}

.fe-sidebar-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 0 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.fe-sidebar-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.fe-sidebar-item.active {
    background-color: #E5F3FF; /* Lighter blue for active item */
    color: #0078D4; /* Windows blue text */
    font-weight: 600;
}
.fe-sidebar-item.active .fe-icon-sidebar {
    color: #0078D4; /* Ensure icon also gets blue color */
}

.fe-icon-sidebar {
    margin-right: 12px;
    font-size: 18px;
    color: #666; /* Default icon color */
    line-height: 1;
}

.fe-content-view {
    flex-grow: 1;
    background-color: white; /* Main content area is white */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center "This folder is empty." */
    align-items: center;
    overflow-y: auto; /* Allow content to scroll */
}

/* NEW: Class for maximized windows */
.maximized-window {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 999 !important; /* Ensure maximized windows are above other non-maximized windows */
}

/* NEW: Styles for the Notepad box in Game Store */
.notepad-box {
    width: 200px;
    height: 150px;
    background-color: darkgray;
    display: flex;
    flex-direction: column; /* Changed to column to stack items */
    align-items: center; /* Center horizontally */
    /* Removed justify-content: center to allow content to align to top */
    color: white;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding-top: 20px; /* Add padding to push content down from the top edge */
}

.notepad-box p {
    margin-top: 0; /* Remove default top margin for the paragraph */
    margin-bottom: 20px; /* Space between text and button */
}

/* NEW: Styles for the Download button inside Notepad box */
.download-button {
    padding: 8px 15px;
    background-color: #0078D4; /* Windows blue */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.download-button:hover {
    background-color: #005ea6; /* Darker blue on hover */
}

/* NEW: Styles for taskbar application icons */
.taskbar-app-icon {
    height: 40px; /* Same as start button height */
    min-width: 48px; /* Slightly wider to match Win11, allows text if needed */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-radius 0.2s ease-in-out;
    border-radius: 4px;
    margin: 0 2px; /* Small space between icons */
}

.taskbar-app-icon:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.taskbar-app-icon.active { /* For the currently focused/open app */
    background-color: rgba(255, 255, 255, 0.25);
    border-bottom: 2px solid #0078D4; /* A blue line to indicate active */
    border-radius: 8px 8px 0 0; /* Only top corners rounded */
}

.taskbar-app-icon img {
    width: 24px; /* Icon size */
    height: 24px;
    object-fit: contain;
}