/* --- GLOBAL STYLES --- */
body {
    background-color: #008080;
    /* You can swap this URL for your preferred wallpaper */
    background-image: url('https://files.catbox.moe/3b5d3d.jpg');
    background-size: cover;
    background-position: center;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Tahoma', sans-serif;
    user-select: none;
    touch-action: none;
}

/* --- DESKTOP ICONS --- */
.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 5;
}

.icon {
    width: 70px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px black;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.icon img { width: 32px; height: 32px; margin-bottom: 5px; }
.icon span { font-size: 11px; padding: 2px; }
.icon:hover span { background-color: #0050cd; }

/* --- WINDOW STYLES --- */
.xp-window {
    background: #ECE9D8;
    border: 1px solid #0055EA;
    border-radius: 8px 8px 0 0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    min-width: 200px;
    min-height: 150px;
    box-sizing: border-box;
}

/* Title Bar */
.title-bar {
    background: linear-gradient(180deg, #245EDC 0%, #3E80F3 5%, #2968EA 10%, #0C4BCC 100%);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px #0f306d;
    cursor: default;
    flex-shrink: 0;
}

.title-bar-controls div {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: white;
    margin-left: 5px;
    border-radius: 3px;
    border: 1px solid white;
    cursor: pointer;
    color: black;
    text-align: center;
    line-height: 18px;
    font-size: 14px;
}

.btn-close { background: #E44B36 !important; color: white !important; }

/* RESIZER HANDLE */
.resizer {
    width: 20px;
    height: 20px;
    position: absolute;
    bottom: 0;
    right: 0;
    cursor: se-resize;
    z-index: 100;
    background: linear-gradient(135deg, transparent 50%, #ACA899 50%);
}

/* --- MAIN WINDOW (Responsive) --- */
#main-window {
    width: 90vw;
    max-width: 800px;
    height: 70vh;
    max-height: 550px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    z-index: 10;
}

.menu-bar { background: #ECE9D8; border-bottom: 1px solid #ACA899; padding: 5px 10px; font-size: 11px; flex-shrink: 0; }
.menu-bar span { margin-right: 15px; cursor: pointer; }

.window-body { flex: 1; display: flex; padding: 10px; gap: 10px; overflow-y: auto; background: white; border: 1px solid #ACA899; margin: 5px; margin-bottom: 15px; }

.sidebar { width: 200px; background: #F0F0F0; border: 1px solid #ACA899; padding: 10px; font-size: 11px; flex-shrink: 0;}
.pfp { width: 100%; height: auto; border: 2px solid #808080; margin-bottom: 10px; display: block; }

.main-content { flex: 1; padding: 0 10px; }
h2 { color: #003399; font-size: 18px; border-bottom: 1px solid #ccc; padding-bottom: 5px; margin-top: 0; }
h3 { font-size: 14px; color: #444; margin-top: 20px; }
p, li { font-size: 12px; line-height: 1.5; }
.update-box { background: #FFFFE1; border: 1px solid #ACA899; padding: 5px; margin-bottom: 5px; font-size: 12px; }

/* --- DOCS WINDOW --- */
#docs-window {
    width: 90vw;
    max-width: 600px;
    height: 60vh;
    max-height: 450px;
    top: 15%;
    left: 15%;
    z-index: 15;
}

/* --- DISPLAY WINDOW --- */
#display-window {
    width: 90vw;
    max-width: 400px;
    top: 20%;
    left: 30%;
    z-index: 16;
}

/* --- PLAYER WINDOW --- */
#music-player-window {
    width: 80vw;
    max-width: 260px;
    height: 160px;
    top: 100px;
    left: 100px;
    z-index: 20; 
}
#player-drag-handle { cursor: move; }
#player-frame { width: 100%; height: 100%; border: none; background: #202020; }

/* --- NOTEPAD WINDOW (Updated IDs) --- */
#notepad-window {
    width: 90vw;
    max-width: 400px;
    height: 50vh;
    max-height: 400px;
    top: 150px;
    left: 150px;
    z-index: 30;
    display: flex;
    flex-direction: column;
}

#notepad-area {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Lucida Console', 'Courier New', monospace;
    font-size: 13px;
    padding: 5px;
    box-sizing: border-box;
    background-color: white;
    color: black;
    line-height: 1.2;
    overflow: auto;
}

/* Custom Scrollbar for Notepad */
#notepad-area::-webkit-scrollbar {
    width: 13px;
    background: #ece9d8;
}
#notepad-area::-webkit-scrollbar-thumb {
    background: #c3c3c3;
    border: 1px solid #fff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
}

/* --- TASKBAR --- */
.taskbar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(180deg, #245EDC 0%, #3E8CE6 5%, #245EDC 10%, #0C4BCC 100%);
    border-top: 1px solid #0046BC;
    display: flex;
    align-items: center;
    z-index: 100;
}

.start-btn {
    background: linear-gradient(180deg, #3C9F41 0%, #46B54B 10%, #3C9F41 100%);
    border: none;
    border-radius: 0 10px 10px 0;
    height: 100%;
    padding: 0 15px 0 10px;
    display: flex;
    align-items: center;
    color: white;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px #000;
    cursor: pointer;
    margin-right: 10px;
}

.tray {
    margin-left: auto;
    background: #0B79E3;
    border-left: 1px solid #114291;
    height: 100%;
    padding: 0 15px;
    display: flex;
    align-items: center;
    color: white;
    font-size: 11px;
}

/* --- MY DOCUMENTS GRID --- */
.file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    align-content: flex-start;
}
.file-item {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}
.file-item:hover {
    background-color: #e8f4ff;
    border: 1px solid #cceeff;
}
.file-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #ccc;
    background: white;
    padding: 2px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.file-name {
    margin-top: 5px;
    font-size: 11px;
    color: black;
    word-wrap: break-word;
}

/* --- MEDIA VIEWER --- */
#media-viewer {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.viewer-content {
    width: 95vw;
    max-width: 800px;
    background: #ECE9D8;
    border: 2px solid #0055EA;
    box-shadow: 0 0 20px black;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.viewer-toolbar {
    background: linear-gradient(180deg, #245EDC 0%, #0C4BCC 100%);
    padding: 5px 10px;
    color: white;
    font-weight: bold;
}
.canvas-container {
    position: relative;
    width: 100%;
    height: 50vh;
    background: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#viewer-img, #viewer-video {
    max-width: 100%;
    max-height: 100%;
    position: absolute;
    z-index: 1; 
    pointer-events: none; 
}
#drawing-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; 
    cursor: crosshair;
}
.editor-controls {
    padding: 10px;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- WALLPAPER SELECTOR --- */
.wallpaper-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.wallpaper-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 100px;
}
.wallpaper-option img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.4);
    transition: transform 0.1s;
}
.wallpaper-option:hover img {
    border-color: #245EDC;
    transform: scale(1.05);
}
.wallpaper-option span {
    margin-top: 5px;
    font-size: 11px;
    color: black;
}

/* --- START MENU --- */
.start-menu {
    position: absolute;
    bottom: 30px; /* Above taskbar */
    left: 0;
    width: 380px;
    background: #fff;
    border-radius: 5px 5px 0 0;
    box-shadow: 2px -2px 10px rgba(0,0,0,0.5);
    z-index: 200; /* Above everything */
    display: flex;
    flex-direction: column;
    border: 1px solid #0055EA;
    overflow: hidden;
}

.start-header {
    background: linear-gradient(180deg, #245EDC 0%, #3E80F3 100%);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.start-pfp {
    width: 40px; height: 40px;
    border: 2px solid white;
    border-radius: 3px;
    margin-right: 10px;
    object-fit: cover;
}

.start-body {
    display: flex;
    height: 350px;
}

.start-col-left {
    width: 50%;
    background: white;
    padding: 10px;
    border-right: 1px solid #ccc;
}

.start-col-right {
    width: 50%;
    background: #D3E5FA; /* Light blue */
    padding: 10px;
    border-left: 1px solid #fff;
}

.start-item {
    display: flex;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 11px;
    color: #333;
}
.start-item:hover {
    background-color: #316AC5;
    color: white;
}
.start-item img {
    width: 24px; height: 24px;
    margin-right: 8px;
}

.start-divider {
    height: 1px;
    background: #ccc;
    margin: 5px 0 10px 0;
    width: 90%;
}

.start-footer {
    background: linear-gradient(180deg, #3E80F3 0%, #245EDC 100%);
    height: 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 10px;
    gap: 10px;
    border-top: 2px solid #F2933C; /* Orange line */
}

.start-btn-footer {
    color: white;
    font-size: 11px;
    cursor: pointer;
    padding: 5px 10px;
}
.start-btn-footer:hover { background: rgba(0,0,0,0.1); border-radius: 3px; }

/* --- BOOT SCREEN STYLES --- */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Tahoma', sans-serif;
    user-select: none;
    transition: opacity 1s ease-out;
}

.boot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 300px;
}

.boot-logo { width: 250px; height: auto; }

.boot-loading-bar {
    width: 200px;
    height: 12px;
    border: 2px solid #b2b2b2;
    border-radius: 3px;
    padding: 2px;
    position: relative;
    background: transparent;
    overflow: hidden;
}

.boot-progress {
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, 
        transparent 0%, 
        #245EDC 20%, 
        #5C92FA 50%, 
        #245EDC 80%, 
        transparent 100%
    );
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
    animation: bootLoad 2s infinite linear;
}

.copyright {
    color: white;
    font-size: 10px;
    margin-top: 20px;
}

@keyframes bootLoad {
    0% { left: -50px; }
    100% { left: 100%; }
}

/* --- MOBILE SPECIFIC TWEAKS --- */
@media (max-width: 768px) {
    .desktop-icons {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }
    
    #main-window {
        top: 50px;
        left: 5vw;
        transform: none;
    }
    
    .window-body { flex-direction: column; }
    
    .sidebar {
        width: auto;
        border-bottom: 1px solid #ccc;
        border-right: none;
    }
    
    .pfp { width: 100px; margin: 0 auto 10px auto; }
    
    .viewer-content { height: auto; max-height: 90vh; }

    .start-menu { width: 300px; }
    .boot-logo { width: 180px; }
    .boot-loading-bar { width: 150px; }
}
