/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #050005;
    --term-green: #00ff00; /* Legacy */
    --hot-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --deep-purple: #1a001a;
    --border-light: #ffccff;
    --border-dark: #660066;
    --taskbar-height: 40px;
    --font-main: 'VT323', monospace;
}

* {
    box-sizing: border-box;
    cursor: crosshair; /* Techdomme crosshair cursor */
    user-select: none; /* UI feel */
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(rgba(255, 0, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px; /* Cyber Grid */
    color: var(--hot-pink);
    font-family: var(--font-main);
    font-size: 20px;
    overflow: hidden; /* Prevent scroll on body, handle inside main */
    height: 100vh;
    text-shadow: 0 0 2px var(--hot-pink);
}

/* --- SCROLLBARS --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--deep-purple); border-left: 1px solid var(--hot-pink); }
::-webkit-scrollbar-thumb { background: var(--hot-pink); border: 1px solid #fff; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* --- CRT OVERLAYS --- */
.crt-vignette {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 998;
}

.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
    opacity: 0.6;
}

/* --- GATEKEEPER (LOGIN) --- */
#gatekeeper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.login-box {
    border: 2px solid var(--hot-pink);
    padding: 40px;
    text-align: center;
    background-color: rgba(10, 0, 10, 0.9);
    box-shadow: 0 0 30px var(--hot-pink), inset 0 0 20px var(--deep-purple);
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* RGB Split Animation */
.glitch {
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 2px 0 var(--hot-pink), -2px 0 var(--neon-cyan);
    animation: noise 2s infinite linear alternate-reverse;
}

@keyframes noise {
    0% { text-shadow: 2px 0 var(--hot-pink), -2px 0 var(--neon-cyan); }
    20% { text-shadow: -2px 0 var(--hot-pink), 2px 0 var(--neon-cyan); transform: skewX(2deg); }
    40% { text-shadow: 2px 0 var(--hot-pink), -2px 0 var(--neon-cyan); transform: skewX(-2deg); }
    100% { text-shadow: 1px 0 var(--hot-pink), -1px 0 var(--neon-cyan); }
}

.terminal-log {
    text-align: left;
    font-family: 'Courier New', monospace;
    color: var(--neon-cyan);
    margin: 20px 0;
    min-height: 100px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.enter-btn {
    background-color: #000;
    color: var(--hot-pink);
    border: 2px solid var(--hot-pink);
    padding: 15px 30px;
    font-family: var(--font-main);
    font-size: 1.5rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
    box-shadow: 5px 5px 0px var(--neon-cyan);
}

.enter-btn:hover {
    background-color: var(--hot-pink);
    color: #fff;
    box-shadow: 2px 2px 0px var(--neon-cyan);
    transform: translate(3px, 3px);
}

.enter-btn:active {
    transform: translate(5px, 5px);
    box-shadow: none;
}

/* --- MAIN UI --- */
#main-interface {
    display: none; /* Hidden until boot */
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden; 
}

/* Desktop Layout */
.desktop-area {
    position: absolute;
    top: 0;
    bottom: var(--taskbar-height);
    left: 0;
    right: 0;
    padding: 20px;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 20px;
}

/* Desktop Icons */
.desktop-icon {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(255, 0, 255, 0.1);
    border: 1px dotted var(--hot-pink);
}

.icon-img {
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 0 #000;
}

.icon-label {
    font-size: 1rem;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 2px 5px;
    text-shadow: 1px 1px 0 #000;
}

/* Draggable Windows */
.window-pane {
    position: absolute;
    background: #000;
    border: 2px outset var(--border-light);
    width: 450px;
    min-height: 200px;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    transition: width 0.2s, height 0.2s, top 0.2s, left 0.2s; 
    display: none; 
}

.window-pane.visible { display: flex; }

.window-pane.maximized {
    width: 100% !important;
    height: calc(100% - var(--taskbar-height)) !important;
    top: 0 !important;
    left: 0 !important;
    box-shadow: none;
    margin: 0;
    border: none;
    border-left: 2px solid var(--border-light);
    border-right: 2px solid var(--border-light);
    z-index: 900; 
}

.window-header {
    background: linear-gradient(90deg, var(--hot-pink), var(--deep-purple));
    color: #fff;
    padding: 4px 8px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move; 
    border-bottom: 2px solid #fff;
    flex-shrink: 0;
}

.window-pane.maximized .window-header { cursor: default; }

.win-controls { display: flex; gap: 2px; }

.win-btn {
    border: 1px solid #fff;
    background: #ccc;
    color: #000;
    width: 16px;
    height: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 1px 1px 0 #000;
}

.win-btn:hover { background: #fff; }
.win-btn.close-btn:hover { background: red; color: white; }

.window-content {
    padding: 15px;
    color: var(--neon-cyan);
    background: rgba(10, 0, 10, 0.95);
    border: 2px inset var(--border-dark);
    margin: 5px;
    flex-grow: 1;
    overflow-y: auto;
    user-select: text; 
}

/* --- START MENU --- */
#start-menu {
    position: absolute;
    bottom: var(--taskbar-height);
    left: 0;
    width: 250px;
    background: rgba(10, 0, 10, 0.95);
    border: 2px outset var(--border-light);
    border-bottom: none;
    display: none; /* Hidden by default */
    flex-direction: column;
    z-index: 995;
    box-shadow: 5px -5px 0 rgba(0,0,0,0.5);
}

.start-header {
    background: linear-gradient(90deg, var(--deep-purple), var(--hot-pink));
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--neon-cyan);
}

.start-pfp {
    width: 40px;
    height: 40px;
    background: #000;
    border: 1px solid #fff;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.start-items {
    list-style: none;
    padding: 5px;
    margin: 0;
}

.start-item {
    padding: 8px 10px;
    color: var(--neon-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-item:hover {
    background: var(--hot-pink);
    color: #fff;
}

.start-footer {
    border-top: 1px solid var(--border-dark);
    padding: 10px;
    text-align: right;
    background: #000;
}

/* --- TASKBAR --- */
.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--taskbar-height);
    background: var(--deep-purple);
    border-top: 2px solid var(--hot-pink);
    display: flex;
    align-items: center;
    padding: 0 5px;
    gap: 5px;
    z-index: 950;
    justify-content: space-between;
}

.taskbar-left { display: flex; align-items: center; gap: 5px; flex-grow: 1; }
.taskbar-right { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding-right: 10px; 
    border-left: 2px inset #555;
    padding-left: 10px;
    height: 80%;
    background: rgba(0,0,0,0.3);
    margin-right: 5px;
}

.start-btn {
    background: var(--hot-pink);
    color: #fff;
    font-weight: bold;
    padding: 4px 15px;
    border: 2px outset #ffccff;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.start-btn:active, .start-btn.active {
    border-style: inset;
    transform: translate(1px, 1px);
}

.taskbar-window-list {
    display: flex;
    gap: 5px;
}

.taskbar-item {
    background: #000;
    color: var(--neon-cyan);
    border: 2px solid #333;
    padding: 2px 10px;
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.taskbar-item.active {
    background: #333;
    border: 2px inset #555;
    color: #fff;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.taskbar-item:hover {
    border-color: var(--hot-pink);
}

/* Typography & Decoration */
h2 {
    color: var(--hot-pink);
    border-bottom: 1px dashed var(--hot-pink);
    margin-top: 0;
}

p, li { line-height: 1.4; }

.blink { animation: blinker 1s step-end infinite; }
@keyframes blinker { 50% { opacity: 0; } }

.sparkle-trail {
    position: fixed;
    pointer-events: none;
    color: var(--hot-pink);
    font-size: 10px;
    z-index: 9999;
    animation: fadeUp 1s forwards;
}

@keyframes fadeUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(0); opacity: 0; }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .desktop-icon { width: 70px; }
    .window-pane { 
        position: fixed; 
        width: 90% !important; 
        height: 60% !important;
        left: 5% !important;
        top: 10% !important;
    }
}