/* ============================
   GLOBAL
   ============================ */
body {
    margin: 0;
    overflow: hidden;
    font-family: Tahoma, sans-serif;
    outline: none;
}

/* ============================
   DESKTOP
   ============================ */
#desktop {
    background: url('https://wallpapercave.com/wp/wp2754881.jpg');
    background-size: cover;
    width: 100vw;
    height: 100vh;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1; /* base layer */
}

/* ============================
   DESKTOP ICONS
   ============================ */
.desktop-icon {
    position: absolute;
    z-index: 2; /* BELOW windows */
    width: 80px;
    text-align: center;
    user-select: none;
}

.desktop-icon img {
    -webkit-user-drag: none;
    pointer-events: none;
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto;
}

.desktop-icon span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: white;
    text-shadow: 1px 1px 2px black;
}

.desktop-icon.selected span {
    background: rgba(180, 180, 180, 0.4);
    border: 1px solid rgba(160, 160, 160, 0.8);
    border-radius: 3px;
    padding: 2px 4px;
}

.desktop-icon.selected {
    background: rgba(0, 120, 215, 0.3);
    outline: 1px solid #0078d7;
    border-radius: 4px;
}

/* ============================
   WINDOWS
   ============================ */
.window {
    min-width: 250px;
    min-height: 150px;
    background: #ECECEC;
    border: 2px solid #999;
    position: absolute;
    top: 100px;
    left: 100px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
    z-index: 1000; /* ABOVE desktop icons */
}

.window.active {
    z-index: 2000; /* topmost window */
}

.title-bar {
    background: #245EDC;
    color: white;
    padding: 5px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.window-buttons button {
    margin-left: 5px;
    cursor: pointer;
}

.window-content {
    padding: 10px;
}

/* ============================
   TASKBAR
   ============================ */
#taskbar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: #245EDC;
    display: flex;
    align-items: center;
    color: white;
    z-index: 3000; /* above windows */
}

#taskbar-apps {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

#taskbar-clock {
    background: #1386e1;
    border: 1px solid #6B8EC6;
    padding: 3px 10px;
    margin-right: 6px;
    border-radius: 4px;
    font-size: 13px;
    color: white;
    user-select: none;
    cursor: default;
    height: 22px;
    display: flex;
    align-items: center;
}

#start-button {
    background: #06b52e;
    padding: 5px 15px;
    margin-left: 5px;
    border: 1px solid #1E4BB8;
    cursor: pointer;
    user-select: none;
}

/* ============================
   START MENU
   ============================ */
#start-menu {
    position: fixed;
    bottom: 40px;
    left: 5px;
    width: 150px;
    background: #ECECEC;
    border: 2px solid #999;
    user-select: none;
    z-index: 3500; /* above taskbar */
}

.start-item {
    padding: 10px;
    cursor: pointer;
}

.start-item:hover {
    background: #D0D0D0;
}

.hidden {
    display: none;
}

/* ============================
   TEXTAREAS
   ============================ */
textarea {
    min-width: 230px;
    width: 100%;
    min-height: 130px;
    height: 140px;
}

/* ============================
   TASKBAR BUTTONS
   ============================ */
.taskbar-btn {
    padding: 5px 10px;
    margin-left: 5px;
    background: #3A6EE8;
    color: white;
    border: 1px solid #1E4BB8;
    cursor: pointer;
    user-select: none;
    display: inline-block;
}

/* ============================
   SELECTION BOX
   ============================ */
#selection-box {
    position: absolute;
    border: 1px solid #3399ff;
    background: rgba(51, 153, 255, 0.3);
    pointer-events: none;
    display: none;
    z-index: 999; /* BELOW windows */
}

/* ============================
   NOTES TOOLBAR
   ============================ */
.notes-toolbar {
    background: #D4D0C8;
    padding: 4px;
    border-bottom: 1px solid #A0A0A0;
}

.notes-toolbar button {
    margin-right: 5px;
    cursor: pointer;
}

/* ============================
   MODALS
   ============================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* top layer */
}

.modal.hidden {
    display: none;
}

.modal-window {
    width: 350px;
    background: #ece9d8;
    border: 2px solid #003c74;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
    padding: 15px;
    font-family: Tahoma, sans-serif;
}

/* ============================
   EAGLERCRAFT LOADER
   ============================ */
#EaglercraftApp {
    width: 900px;
    height: 600px;
}

#EaglercraftApp .window-content {
    padding: 0;
}

.eagler-window {
    position: relative;
    top: 30px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: none;
}

.eagler-drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed #808080;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    color: #404040;
    background-color: #f0f0f0;
    cursor: pointer;
    z-index: 1; /* BELOW iframe */
}

.eagler-drop-zone.dragover {
    border-color: #0057e7;
    background-color: #dde8ff;
}

.eagler-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    display: none;
    pointer-events: auto;
    z-index: 2; /* ABOVE drop zone */
}

.resize-handle {
    width: 14px;
    height: 14px;
    background: url('data:image/svg+xml;utf8,<svg width="14" height="14" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="14" x2="14" y2="0" stroke="%23999" stroke-width="2"/></svg>');
    position: absolute;
    right: 2px;
    bottom: 2px;
    cursor: se-resize;
    z-index: 200;
}

.eagler-activation-layer {
    position: absolute;
    inset: 0;
    z-index: 999999;
    background: transparent;
}
