/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;600&display=swap');

:root {
    --win-bg: #f3f3f3;
    --win-glass: rgba(243, 243, 243, 0.85);
    --win-dark-glass: rgba(32, 32, 32, 0.75);
    --taskbar-bg: rgba(243, 243, 243, 0.85); /* Light Mode default */
    --start-bg: rgba(243, 243, 243, 0.95);
    --accent: #0067c0;
    --text-primary: #1a1a1a;
    --text-secondary: #5d5d5d;
    --border-lite: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --win-bg: #202020;
    --win-glass: rgba(32, 32, 32, 0.85);
    --win-dark-glass: rgba(20, 20, 20, 0.9);
    --taskbar-bg: rgba(32, 32, 32, 0.85);
    --start-bg: rgba(32, 32, 32, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-lite: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    user-select: none;
    background-color: #000;
}

/* ===========================
   BOOT SCREEN
   =========================== */
#boot-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    color: white;
}
.boot-spinner {
    width: 50px; height: 50px;
    border: 4px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ===========================
   LOCK SCREEN
   =========================== */
#lock-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000;
    background-image: url('https://4kwallpapers.com/images/wallpapers/windows-11-blue-stock-official-3840x2160-5630.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s ease-in-out, opacity 0.5s;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.lock-time {
    margin-top: 15vh;
    text-align: center;
    transition: opacity 0.3s;
}
.lock-time h1 { font-size: 96px; font-weight: 300; margin: 0; line-height: 1; }
.lock-time h2 { font-size: 28px; font-weight: 400; margin: 10px 0 0 0; }

.login-form {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 30vh;
    animation: fadeIn 0.5s;
}

.user-avatar {
    width: 120px; height: 120px;
    background: #444;
    border-radius: 50%;
    margin-bottom: 15px;
    display: flex; justify-content: center; align-items: center;
    font-size: 50px; color: #ccc;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.pass-input-group {
    display: flex;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 2px;
}
.pass-input-group:focus-within {
    background: #fff;
    border-color: #fff;
}
.pass-input-group input {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 12px;
    outline: none;
    width: 200px;
}
.pass-input-group:focus-within input { color: #000; }
.pass-arrow {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0 10px;
}
.pass-input-group:focus-within .pass-arrow { color: #555; }

/* ===========================
   DESKTOP
   =========================== */
#desktop {
    width: 100vw; height: 100vh;
    background: url('https://4kwallpapers.com/images/wallpapers/windows-11-blue-stock-official-3840x2160-5630.jpg') no-repeat center center/cover;
    position: relative;
    overflow: hidden;
}

.desktop-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    height: 100%;
    align-content: flex-start;
    padding: 10px;
    gap: 10px;
}

.desktop-icon {
    width: 86px;
    height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: default;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    transition: background 0.1s;
}
.desktop-icon:hover {
    background: rgba(255,255,255,0.1);
}
.desktop-icon.selected {
    background: rgba(255,255,255,0.2);
}
.desktop-icon img {
    width: 48px; height: 48px;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.desktop-icon span {
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================
   TASKBAR
   =========================== */
#taskbar {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    height: 48px;
    background: var(--taskbar-bg);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 9000;
    border-top: 1px solid var(--border-lite);
}

.taskbar-center {
    display: flex;
    gap: 8px;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-grow: 1; /* Center it */
}

.taskbar-icon {
    width: 36px; height: 36px;
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    position: relative;
}
.taskbar-icon:hover {
    background: rgba(255,255,255,0.15); /* Light hover overlay */
}
.taskbar-icon:active {
    transform: scale(0.95);
}
.taskbar-icon img {
    width: 24px; height: 24px;
}
.taskbar-icon.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 12px; height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.taskbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 80%;
    padding-right: 10px;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.system-tray:hover { background: rgba(255,255,255,0.1); }
.system-tray i { font-size: 14px; }

.clock-area {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.clock-area:hover { background: rgba(255,255,255,0.1); }


/* ===========================
   START MENU
   =========================== */
#start-menu {
    position: absolute;
    bottom: 60px; /* above taskbar */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 600px;
    height: 650px;
    background: var(--start-bg);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    border: 1px solid var(--border-lite);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 9001;
    display: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    flex-direction: column;
    padding: 24px;
    color: var(--text-primary);
}
#start-menu.show {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.start-search {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border: 1px solid transparent;
    border-radius: 4px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 20px;
}
.start-search input {
    background: transparent; border: none; outline: none;
    width: 100%; font-size: 14px;
    color: var(--text-primary);
}

.pinned-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.pinned-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; padding: 10px 0; border-radius: 4px;
}
.pinned-item:hover { background: rgba(255,255,255,0.05); }
.pinned-item img { width: 32px; height: 32px; }
.pinned-item span { font-size: 11px; color: var(--text-primary); }

.recommended-list {
    flex-grow: 1;
}

.start-footer {
    border-top: 1px solid var(--border-lite);
    padding-top: 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.user-profile {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; padding: 5px; border-radius: 4px;
}
.user-profile:hover { background: rgba(255,255,255,0.05); }
.user-pic { width: 30px; height: 30px; border-radius: 50%; background: #555; }
.power-btn {
    width: 30px; height: 30px; display: flex; center; align-items:center; justify-content:center;
    border-radius: 4px; cursor: pointer;
}
.power-btn:hover { background: rgba(255,255,255,0.1); }


/* ===========================
   WINDOWS
   =========================== */
.window {
    position: absolute;
    background: var(--win-glass);
    backdrop-filter: blur(25px);
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.4);
    border: 1px solid var(--border-lite);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px; min-height: 200px;
    resize: both;
    animation: scaleUp 0.2s ease-out;
}
@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.title-bar {
    height: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    cursor: grab;
}
.title-text { font-size: 12px; color: var(--text-primary); display: flex; align-items: center; gap: 10px; font-weight: 500;}
.window-controls { display: flex; height: 100%; }
.win-btn {
    width: 40px; height: 100%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    font-size: 14px; color: var(--text-primary);
}
.win-btn:hover { background: rgba(255,255,255,0.1); }
.win-btn.close:hover { background: #e81123; color: white; }

.window-body {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.5); /* Semi-transparent white */
}
[data-theme="dark"] .window-body { background: rgba(0,0,0,0.5); }


/* TERMINAL SPECIFIC styles */
#term-body {
    background: #0c0c0c;
    color: #cccccc;
    font-family: 'Consolas', 'Courier New', monospace;
    padding: 5px;
    overflow-y: auto;
    height: 100%;
}
.term-line {
    margin-bottom: 2px;
    line-height: 1.4;
}
.cmd-prompt { color: #0f0; }
.cmd-path { color: #00bcd4; }
