/* --- MS PAINT SYSTEM UI --- */
body {
    background-color: #008080; /* Classic Teal Desktop */
    margin: 0;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Space Mono', monospace;
}

.paint-container {
    background: #d4d0c8;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    box-shadow: 2px 2px 0px #000;
}

/* WINDOW HEADER */
.window-header {
    height: 25px;
    background: linear-gradient(90deg, #000080, #1084d0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    color: white;
}

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

.window-controls .ctrl {
    background: #d4d0c8;
    border: 1px solid;
    border-color: #fff #808080 #808080 #fff;
    color: #000;
    padding: 0 5px;
    margin-left: 2px;
    cursor: pointer;
    font-size: 10px;
}

#global-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Allows clicks to pass through to buttons */
    z-index: 10; /* Sits above the UI */
}

.paint-pixel {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #000;
    pointer-events: none;
    z-index: 11;
}

/* Ensure the body is ready for absolute pixels */
body {
    overflow: hidden; /* Prevents the whole page from scrolling away from your drawings */
}

/* MENU BAR */
.paint-menu-bar {
    padding: 2px 10px;
    font-size: 11px;
    border-bottom: 1px solid #808080;
    display: flex;
    gap: 12px;
}

.paint-menu-bar span:first-letter { text-decoration: underline; }

/* THE MAIN WORKSPACE */
.paint-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #808080; /* The dark grey 'desk' */
}

/* TOOLBAR */
.paint-toolbar {
    width: 52px;
    background: #d4d0c8;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 4px;
    border-right: 1px solid #808080;
    align-content: start;
}

.tool-icon {
    width: 25px; /* Bumped up slightly to fit better */
    height: 25px;
    border: 1px solid;
    border-color: #fff #808080 #808080 #fff;
    background: #d4d0c8;
    cursor: pointer;

    /* THE FIXES */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;   /* Keeps icons from leaking out */
    font-size: 14px;    /* Uniform size for all emojis/text */
    line-height: 1;     /* Prevents vertical shifting */
    user-select: none;  /* Prevents the text from being highlighted while clicking */
}

/* Specific fix for the 'polygon' and '**A**' text being too long */
.tool-icon[title="Polygon"], 
.tool-icon[title="Text"],
.tool-icon[title="Rounded Rectangle"] {
    font-size: 10px;    /* Shorter text needs a smaller font */
    font-weight: bold;
}

.tool-icon.selected {
    background: #fff;
    border-color: #808080 #fff #fff #808080;
}

/* THE CANVAS (THE PAPER) */
.drawing-canvas {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.paper {
    background: white;
    min-width: 800px;
    min-height: 1000px;
    padding: 40px;
    cursor: crosshair;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
}

/* THE COLORS (BOTTOM BAR) */
.paint-colors {
    height: 50px;
    background: #d4d0c8;
    border-top: 1px solid #808080;
    display: flex;
    align-items: center;
    padding: 5px 15px;
    gap: 15px;
}

.current-colors-preview {
    position: relative;
    width: 30px;
    height: 30px;
}

.color-box {
    width: 15px;
    height: 15px;
    border: 1px solid #000;
    position: absolute;
}
.color-box.back { top: 10px; left: 10px; z-index: 1; }
.color-box.front { top: 0; left: 0; z-index: 2; }

.palette-grid {
    display: grid;
    grid-template-columns: repeat(14, 15px);
    grid-template-rows: repeat(2, 15px);
    gap: 1px;
    border: 1px solid #808080;
}

.swatch {
    width: 15px;
    height: 15px;
    border: 1px solid #fff;
    box-shadow: inset 1px 1px 0px #808080;
}

/* MOODBOARD STYLING */
.mood-item-selected {
    display: inline-block;
    padding: 5px;
    border: 1px dashed #000;
    outline: 1px dashed #fff;
    margin: 20px;
}

.mood-item-selected {
    position: relative;
    padding: 10px;
    border: 1px dashed #000;
    animation: marching-ants 0.5s infinite linear;
}

/* The trick: a second white border underneath the black one */
.mood-item-selected::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 1px dashed #fff;
    margin: -1px; 
    z-index: -1;
}

@keyframes marching-ants {
    from { background-position: 0 0; }
    to { background-position: 10px 10px; }
}

/* --- 4. THE SYSTEM TASKBAR (Restored for Secret Page) --- */
.system-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #d4d0c8; 
    border-top: 2px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 2px 10px;
    z-index: 99999;
    box-sizing: border-box;
    font-family: 'Space Mono', monospace;
}

.task-tabs {
    display: flex;
    gap: 4px;
    flex-grow: 1;
    align-items: center;
    margin-left: 10px;
}

.task-tab, .start-btn {
    background: #d4d0c8;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 12px;
    font-size: 11px;
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    height: 28px;
    user-select: none;
}

.task-tab.highlight {
    background: #e0e0e0;
    border-color: #808080 #ffffff #ffffff #808080;
    font-weight: bold;
    color: #2e59ff;
}

.system-clock {
    background: #d4d0c8;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 10px;
    font-size: 11px;
    margin-left: 10px;
    height: 28px;
    display: flex;
    align-items: center;
    min-width: 65px;
    justify-content: center;
}