
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}

#first-boot, #second-boot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

#first-boot { z-index: 101; background-color: #000; cursor: pointer; }
#second-boot { background-color: #000; }

.boot-logo { width: 100px; height: 100px; object-fit: contain; margin-bottom: 20px; }
.progress-bar-container { width: 200px; height: 8px; border: 1px solid #555; border-radius: 4px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background-color: #fff; animation: fill-progress 5s linear forwards; }
@keyframes fill-progress { from { width: 0%; } to { width: 100%; } }

#desktop {
    width: 100%;
    height: 100%;
    background: url('https://4kwallpapers.com/images/wallpapers/macos-big-sur-apple-layers-fluidic-colorful-wwdc-stock-2880x1800-1455.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-auto-rows: 100px;
    gap: 10px;
    padding: 20px;
    box-sizing: border-box;
    align-content: flex-start;
    overflow: auto;
}

.hidden { display: none !important; }
.fading-out { animation: fade-out 1s forwards; }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Tutorial Styles */
#tutorial-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 1100;
    display: flex;
    flex-direction: column;
}
#tutorial-content { padding: 20px; text-align: center; }
#tutorial-nav {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: rgba(255,255,255,0.1);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
#tutorial-nav button {
    background: #007aff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}
#tutorial-nav button:hover { background: #0056b3; }
#tutorial-close { background: #555; }
#tutorial-close:hover { background: #333; }

/* Context Menus */
#context-menu, #icon-context-menu {
    position: absolute;
    z-index: 1000;
    width: 200px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#context-menu ul, #icon-context-menu ul { list-style: none; margin: 0; padding: 0; }
#context-menu ul li, #icon-context-menu ul li { padding: 8px 12px; cursor: pointer; color: #333; position: relative; }
#context-menu ul li:hover, #icon-context-menu ul li:hover { background-color: rgba(0, 122, 255, 0.9); color: #fff; }

.sub-menu { position: absolute; top: 0; left: 100%; width: 200px; background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); border-radius: 8px; padding: 5px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); display: none; }
.has-submenu:hover .sub-menu { display: block; }

.delete-option { color: #ff3b30 !important; }
.delete-option:hover { background-color: #ff3b30 !important; color: #fff !important; }

/* Desktop & Folder Icons */
.desktop-icon, .folder-item {
    width: 70px;
    text-align: center;
    cursor: grab;
    transition: transform 0.1s ease-in-out;
    justify-self: center;
    align-self: start;
}
.desktop-icon {
    position: relative;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.desktop-icon i { font-size: 40px; }
.desktop-icon p {
    margin: 5px 0 0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.folder-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 10px;
    color: #333;
    position: relative;
}
.folder-item i { font-size: 40px; margin-bottom: 5px; }
.folder-item p { font-size: 12px; margin: 0; }

.dragging { z-index: 8000 !important; transform: scale(1.1); }
.droppable-folder { background-color: rgba(0, 122, 255, 0.3); border-radius: 8px; }

.rename-input {
    width: 100%;
    border: 1px solid #007aff;
    outline: none;
    text-align: center;
    user-select: text; /* Allow text selection in input fields */
}

/* Windows */
.window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 500;
    min-width: 200px; 
    min-height: 150px;
    resize: both;
    overflow: hidden;
}

.window-resizer {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    cursor: se-resize;
}

.window-header {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.window-title { font-weight: bold; color: #333; }
.window-close { background: #ff5f57; border: none; width: 12px; height: 12px; border-radius: 50%; cursor: pointer; }
.window-content {
    flex-grow: 1;
    padding: 10px;
    color: #333;
    overflow-y: auto;
    position: relative; /* For absolute positioning of folder items */
}

.resize-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none;
}

.resizing .resize-overlay {
    display: block;
}


.window-content .folder-item {
    display: inline-flex;
}

.window-content iframe, .window-content textarea { 
    width: 100%; 
    height: 100%; 
    border: none; 
    background: transparent; 
    resize: none; 
    user-select: text; /* Allow text selection in textareas */
}