:root {
    --bg-dark: #121212;
    --accent: #8a2be2;
    --accent-glow: rgba(138, 43, 226, 0.5);
    --window-bg: rgba(22, 22, 22, 0.85);
    --header-bg: rgba(35, 35, 35, 0.95);
    --text: #e0e0e0;
    --text-dim: #b0b0b0;
    --glass: rgba(255, 255, 255, 0.05);
    --terminal-green: #39ff14;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: var(--text);
}

#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: url('../images/wallpaper.png') center/cover no-repeat;
    display: flex;
    flex-direction: column;
}

.desktop-icons {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    grid-auto-rows: 100px;
    gap: 1.5rem;
    flex: 1;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    text-align: center;
    padding: 10px;
}

.icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon img, .icon .emoji {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.icon span {
    font-size: 0.85rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-weight: 500;
}

/* Window Styling */
.window {
    position: absolute;
    background: var(--window-bg);
    border: 1px solid var(--glass);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* Transitions only for automated movements, not for dragging/resizing */
.window.snapping {
    transition: all 0.3s ease-out;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 48px) !important;
    border-radius: 0;
}

.window.tiled-left {
    top: 0 !important;
    left: 0 !important;
    width: 50% !important;
    height: calc(100% - 48px) !important;
    border-radius: 0;
}

.window.tiled-right {
    top: 0 !important;
    left: 50% !important;
    width: 50% !important;
    height: calc(100% - 48px) !important;
    border-radius: 0;
}

#snap-ghost {
    position: absolute;
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid var(--accent);
    display: none;
    pointer-events: none;
    z-index: 500;
    transition: all 0.15s ease;
}

#window-terminal, #window-about, #window-faq {
    width: 600px;
    height: 400px;
    z-index: 10;
}

#window-terminal {
    top: 20%;
    left: calc(50% - 300px);
}

.window.minimized {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
}

.window-header {
    height: 36px;
    background: var(--header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    cursor: move;
}

.window-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
}

.control.close { background: #ff5f56; }
.control.maximize { background: #27c93f; }
.control.minimize { background: #ffbd2e; }

.window-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    font-size: 0.95rem;
}

/* Terminal Content */
.window-content.terminal {
    background: #000;
    font-family: 'Fira Code', monospace;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

#terminal-output {
    flex: 1;
}

.terminal-welcome {
    color: var(--accent);
    margin-bottom: 1rem;
}

.terminal-input-line {
    display: flex;
    gap: 8px;
}

.prompt {
    color: var(--terminal-green);
    white-space: nowrap;
}

#terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-family: inherit;
    font-size: inherit;
    flex: 1;
}

.terminal a {
    color: var(--terminal-green);
    text-decoration: underline;
}

/* Resizer Styling */
.resizer {
    width: 15px;
    height: 15px;
    position: absolute;
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
    z-index: 100;
}

.resizer::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: transparent transparent var(--text-dim) transparent;
    opacity: 0.5;
}

/* Text Editor & Markdown Content */
.text-editor h2, .markdown h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.text-editor p, .markdown p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Taskbar */
#taskbar {
    height: 48px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 1000;
}

.start-btn {
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: transform 0.2s;
}

.start-btn:hover {
    transform: scale(1.1);
}

.start-btn img {
    width: 100%;
}

.taskbar-items {
    display: flex;
    gap: 5px;
    flex: 1;
}

.taskbar-item {
    padding: 0 1rem;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.taskbar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-item.active {
    background: var(--glass);
    border-bottom: 2px solid var(--accent);
}

.clock {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 58px;
    left: 10px;
    width: 250px;
    background: var(--header-bg);
    border: 1px solid var(--glass);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 1001;
}

.menu-item {
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.menu-item:hover {
    background: var(--accent);
}

.menu-divider {
    height: 1px;
    background: var(--glass);
    margin: 8px 0;
}
