/* Reset & Core Font Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, button {
    font-family: "Tahoma", "MS Sans Serif", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: none;
    overflow: hidden;
    user-select: none;
}

/* CRT Screen Scanline Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.12) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
    z-index: 999999;
    pointer-events: none;
}

/* Boot Screen Simulation */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 24px;
    padding: 40px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.boot-loader {
    width: 300px;
    height: 20px;
    border: 2px solid #00ff00;
    padding: 2px;
    margin-top: 20px;
}

.boot-progress {
    height: 100%;
    background-color: #00ff00;
    width: 0%;
    animation: loadSystem 1.8s ease-in-out forwards;
}

@keyframes loadSystem {
    0% { width: 0%; }
    20% { width: 15%; }
    50% { width: 45%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

/* Desktop Setup */
#desktop {
    background-color: #008080; /* Vintage Teal */
    width: 100vw;
    height: calc(100vh - 40px);
    position: relative;
    padding: 20px;
}

.desktop-icons {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 80px;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 18px;
}

.icon-pix {
    font-size: 32px;
    margin-bottom: 4px;
    transition: transform 0.1s ease;
}

.icon:hover .icon-pix {
    transform: scale(1.1);
}

.icon-label {
    text-shadow: 1px 1px #000;
    padding: 2px 4px;
}

.icon:hover .icon-label {
    background-color: #000080;
    outline: 1px dotted #fff;
}

#secret-trigger {
    position: absolute;
    bottom: 20px;
    right: 20px;
    opacity: 0.15;
    transition: opacity 0.3s;
}
#secret-trigger:hover { opacity: 0.8; }

/* Window Styles & Entry Animation */
.window {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #fff #0a0a0a #0a0a0a #fff;
    box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #808080, 4px 4px 10px rgba(0,0,0,0.3);
    width: 420px;
    position: absolute;
    top: 25%;
    left: 35%;
    padding: 3px;
    z-index: 10;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 4px 3px 6px;
    font-weight: bold;
    cursor: move; /* Indicates window can be dragged */
}

.title-bar-controls button {
    background-color: #c0c0c0;
    border: 1px solid;
    border-color: #fff #0a0a0a #0a0a0a #fff;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: black;
}

.title-bar-controls button:active {
    border-color: #0a0a0a #fff #fff #0a0a0a;
    padding: 1px 0px 0px 1px;
}

.window-body {
    margin: 8px;
    background-color: #fff;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    padding: 15px;
    min-height: 160px;
    color: black;
    user-select: text;
}

/* Taskbar Environment */
#taskbar {
    background-color: #c0c0c0;
    height: 40px;
    border-top: 2px solid #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    display: flex;
    align-items: center;
    padding: 2px 6px;
    justify-content: space-between;
    z-index: 9999;
}

#start-button {
    background-color: #c0c0c0;
    font-weight: bold;
    border: 2px solid;
    border-color: #fff #0a0a0a #0a0a0a #fff;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

#start-button:active {
    border-color: #0a0a0a #fff #fff #0a0a0a;
}

.taskbar-windows {
    flex-grow: 1;
    margin-horizontal: 10px;
    display: flex;
    gap: 4px;
    padding-left: 10px;
}

.taskbar-item {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #fff #0a0a0a #0a0a0a #fff;
    padding: 2px 12px;
    font-weight: bold;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-item.active {
    border-color: #0a0a0a #fff #fff #0a0a0a;
    background-color: #e0e0e0;
}

#system-tray {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    padding: 4px 8px;
    font-size: 12px;
}
