/* --- THEME DEFINITIONS --- */
:root {
    /* CLASSIC THEME */
    --bg-color: #008080;
    --win-bg: #c0c0c0;
    --win-text: #000;
    --win-border: 3px solid #000080; /* Blue borders for Classic */
    --header-bg: linear-gradient(90deg, #000080, #1084d0);
    --header-text: #fff;
    --taskbar-bg: #c0c0c0;
    --taskbar-border: 2px solid #000080;
    --content-bg: #fff;
}

body.dark-mode {
    --bg-color: #000;
    --win-bg: #1a1a1a;
    --win-text: #fff;
    --win-border: 2px solid #444; /* Dark gray borders */
    --header-bg: #333;
    --header-text: #fff;
    --taskbar-bg: #1a1a1a;
    --taskbar-border: 2px solid #444;
    --content-bg: #000;
}

body.light-mode {
    --bg-color: #fff;
    --win-bg: #f0f0f0;
    --win-text: #000;
    --win-border: 2px solid #ccc; /* Light gray borders */
    --header-bg: #e0e0e0;
    --header-text: #000;
    --taskbar-bg: #f0f0f0;
    --taskbar-border: 2px solid #ccc;
    --content-bg: #fff;
}

/* APPLYING THE THEMES */
#taskbar {
    background: var(--taskbar-bg);
    border-top: var(--taskbar-border);
}

.window {
    background: var(--win-bg);
    border: var(--win-border);
    color: var(--win-text);
}

.window-content {
    background: var(--content-bg);
    color: var(--win-text);
}

/* System Tray Styles */
.sys-tray {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-right: 10px;
}

.tray-icon {
    cursor: pointer;
    font-size: 1.2rem;
}

.color-grid { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.color-grid button { width: 30px; height: 30px; border: 1px solid #000; cursor: pointer; }

/* Ensure the background applies the variable */
body {
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--win-text);
    /* ... keep the rest of your body styles ... */
}

.window {
    background: var(--win-bg);
    border-color: var(--border-light) var(--border-dark) var(--border-dark) var(--border-light);
}

.window-header {
    background: var(--header-bg);
    color: var(--header-text);
}

.window-content {
    background: var(--content-bg);
    color: var(--win-text);
}

/* Desktop & Icons */
#desktop {
    width: 100%;
    height: calc(100% - 40px);
    position: relative;
    padding: 20px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
}
/* Unique placements for icons on boot */
#icon-about { top: 30px; left: 30px; }
#icon-gym   { top: 30px; left: 130px; }
#icon-blog  { top: 150px; left: 30px; }
#icon-msg   { top: 150px; left: 130px; }
#icon-set   { top: 270px; left: 30px; }

.drawer-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

.drawer-icon img { width: 48px; }

.drawer-icon span {
    color: white;
    font-size: 12px;
    margin-top: 5px;
    text-shadow: 1px 1px 2px black;
}

/* Windows */
.window {
    position: absolute;
    width: 350px;
    min-height: 200px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff; /* 3D effect */
    display: flex;
    flex-direction: column;
}

.window-header {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.window-header .title { font-size: 13px; font-weight: bold; }

.controls { display: flex; gap: 2px; }

.win-btn {
    width: 18px;
    height: 18px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #404040 #404040 #ffffff;
    font-size: 10px;
    cursor: pointer;
}

.window-content {
    background: white;
    margin: 3px;
    padding: 10px;
    border: 2px inset #808080;
    flex-grow: 1;
    overflow-y: auto;
}

/* Blog/Terminal Style */
.system-log {
    background: black;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 0 5px;
    z-index: 10000;
}

#start-btn {
    font-weight: bold;
    height: 30px;
    padding: 0 10px;
    border: 2px outset #fff;
    background: #c0c0c0;
    margin-right: 10px;
}

#clock {
    margin-left: auto;
    padding: 0 10px;
    font-size: 14px;
    border-left: 2px inset #ffffff;
}

/* Login Screen Overlay */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000; /* Black boot screen */
    z-index: 99999; /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #0f0; /* Terminal Green */
    font-family: 'Courier New', Courier, monospace;
}

.login-box {
    text-align: center;
    border: 2px solid #0f0;
    padding: 40px;
    background: #111;
}

.os-logo {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 5px;
}

/* Draggable Icons Update */
.drawer-icon {
    position: absolute; /* REQUIRED for dragging */
    width: 80px;
    cursor: grab;
    z-index: 5;
}

.drawer-icon:active { cursor: grabbing; }

/* Set default positions for icons so they don't stack */
#icon-about { top: 20px; left: 20px; }
#icon-gym   { top: 120px; left: 20px; }
#icon-blog  { top: 220px; left: 20px; }