:root {
    --bg-color: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=2564&auto=format&fit=crop');
    --glass-bg: rgba(25, 25, 30, 0.75); --glass-border: rgba(255, 255, 255, 0.15);
    --accent: #007aff; --text-main: #ffffff; --text-muted: #a1a1aa;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }
body { height: 100vh; width: 100vw; overflow: hidden; background: var(--bg-color) center/cover no-repeat; color: var(--text-main); user-select: none; }
.glass { background: var(--glass-bg); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid var(--glass-border); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }

/* Элементы ОС */
.os-input { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); color: #fff; padding: 8px 12px; border-radius: 6px; outline: none; }
.os-input:focus { border-color: var(--accent); }
.os-btn { background: var(--accent); color: #fff; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.os-btn:hover { filter: brightness(1.2); }
.os-select { background: #2d2d35; color: #fff; border: 1px solid var(--glass-border); padding: 8px; border-radius: 6px; }

/* Рабочий стол и Таскбар */
#desktop { position: absolute; top: 0; left: 0; right: 0; bottom: 50px; padding: 15px; display: flex; flex-direction: column; flex-wrap: wrap; gap: 15px; align-content: flex-start; }
.desktop-icon { width: 75px; text-align: center; cursor: pointer; padding: 8px 5px; border-radius: 8px; transition: 0.2s; }
.desktop-icon:hover { background: rgba(255,255,255,0.1); }
.desktop-icon i { font-size: 36px; color: #fff; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.desktop-icon span { display: block; font-size: 12px; margin-top: 5px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); word-wrap: break-word; }

#taskbar { position: absolute; bottom: 0; left: 0; width: 100%; height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 0 15px; z-index: 10000; transition: top 0.3s, bottom 0.3s; }
.taskbar-left, .taskbar-center, .taskbar-right { display: flex; align-items: center; gap: 8px; }
.taskbar-center { flex-grow: 1; justify-content: flex-start; margin-left: 10px; }
.taskbar-icon { width: 38px; height: 38px; border-radius: 8px; border: none; background: transparent; color: white; font-size: 22px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; position: relative;}
.taskbar-icon:hover { background: rgba(255,255,255,0.1); }
.taskbar-icon.active::after { content: ''; position: absolute; bottom: 2px; left: 30%; width: 40%; height: 3px; background: var(--accent); border-radius: 3px; }

/* Пуск и Меню */
#start-menu { 
    position: absolute; bottom: 60px; left: 15px; width: 650px; height: 550px; 
    border-radius: 16px; display: flex; flex-direction: column; padding: 25px; 
    z-index: 9999; 
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; 
    opacity: 1; transform: translateY(0); visibility: visible;
}
#start-menu.hidden { 
    opacity: 0; transform: translateY(20px); pointer-events: none; visibility: hidden;
}
.start-search { position: relative; margin-bottom: 20px; }
.start-search input { width: 100%; padding: 12px 12px 12px 40px; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.25); color: white; outline: none; font-size: 14px; }
.start-search i { position: absolute; left: 12px; top: 14px; font-size: 18px; color: var(--text-muted); }
.start-content { display: flex; gap: 20px; height: 100%; overflow: hidden;}
.start-all-apps, .start-pinned { flex: 1; overflow-y: auto; padding-right: 10px;}
.start-all-apps ul { list-style: none; margin-top: 10px; }
.start-all-apps li { padding: 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 12px; margin-bottom: 2px; transition: 0.2s;}
.start-all-apps li:hover { background: rgba(255,255,255,0.1); }
.pinned-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.pinned-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 15px 5px; cursor: pointer; border-radius: 8px; transition: 0.2s;}
.pinned-item:hover { background: rgba(255,255,255,0.1); }
.pinned-item i { font-size: 32px; }

#context-menu { position: absolute; z-index: 10001; min-width: 150px; border-radius: 8px; padding: 5px; display: flex; flex-direction: column; }
#context-menu.hidden { display: none; }
.ctx-item { padding: 8px 12px; border-radius: 5px; cursor: pointer; font-size: 13px; transition: 0.1s; }
.ctx-item:hover { background: var(--accent); color: white; }

/* Окна */

.os-window { position: absolute; resize: both; min-width: 400px; min-height: 300px; width: 800px; height: 500px; background: rgba(30, 30, 36, 0.95); border-radius: 12px; border: 1px solid var(--glass-border); box-shadow: 0 15px 40px rgba(0,0,0,0.6); display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(10px); }
.window-header { height: 40px; background: rgba(255,255,255,0.03); display: flex; justify-content: space-between; align-items: center; padding: 0 15px; cursor: grab; border-bottom: 1px solid rgba(255,255,255,0.05); }
.window-header:active { cursor: grabbing; }
.window-title { font-size: 13px; font-weight: 500; pointer-events: none; }
.window-controls { display: flex; gap: 8px; }
.win-btn { width: 14px; height: 14px; border-radius: 50%; border: none; cursor: pointer; }
.btn-close { background: #ff5f56; } .btn-close:hover { background: #ff3b30; }
.btn-max { background: #28c940; } .btn-max:hover { background: #1dad2b; }
.btn-min { background: #ffbd2e; } .btn-min:hover { background: #e5a728; }
.window-body { flex: 1; position: relative; display: flex; overflow: hidden; }

/* Приложения */
.app-settings { display: flex; width: 100%; height: 100%; }
.settings-sidebar { width: 220px; background: rgba(0,0,0,0.2); padding: 15px 10px; }
.settings-sidebar div { padding: 10px 15px; border-radius: 6px; cursor: pointer; margin-bottom: 5px; color: var(--text-muted); transition: 0.2s; }
.settings-sidebar div:hover { background: rgba(255,255,255,0.05); }
.settings-sidebar div.active { background: var(--accent); color: white; }
.settings-content { flex: 1; padding: 30px; overflow-y: auto; }
.settings-content h2 { margin-bottom: 20px; font-size: 20px; font-weight: 500;}
.sys-info-grid { display: grid; grid-template-columns: 180px 1fr; gap: 12px 0; font-size: 14px; }
.info-label { color: var(--text-muted); }
.storage-bar { width: 100%; height: 20px; background: #2d2d35; border-radius: 10px; overflow: hidden; margin-bottom: 10px;}
.storage-used { height: 100%; background: var(--accent); transition: width 0.5s;}
hr { border: 0; height: 1px; background: var(--glass-border); margin: 25px 0; }
.hidden { display: none !important; }

.app-notepad { display: flex; flex-direction: column; width: 100%; height: 100%; }
.app-notepad textarea { flex: 1; background: transparent; border: none; color: white; padding: 20px; font-size: 14px; resize: none; outline: none; }
.notepad-statusbar { height: 35px; background: rgba(0,0,0,0.2); display: flex; align-items: center; gap: 20px; padding: 0 15px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--glass-border); }

.app-explorer { display: flex; flex-direction: column; width: 100%; height: 100%; }
.explorer-toolbar { height: 50px; background: rgba(0,0,0,0.1); border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; padding: 0 15px; gap: 10px; }
.explorer-toolbar button { background: transparent; border: none; color: white; font-size: 20px; cursor: pointer; padding: 5px; border-radius: 5px;}
.explorer-toolbar button:hover { background: rgba(255,255,255,0.1); }
#exp-path { flex: 1; }
.explorer-body { flex: 1; padding: 15px; display: flex; flex-wrap: wrap; gap: 15px; align-content: flex-start; overflow-y: auto; }
.explorer-item { width: 80px; text-align: center; cursor: pointer; padding: 10px 5px; border-radius: 8px; transition: 0.1s; }
.explorer-item:hover { background: rgba(255,255,255,0.1); }
.explorer-item i { font-size: 40px; color: var(--accent); }
.explorer-item span { display: block; font-size: 12px; margin-top: 5px; word-wrap: break-word;}

.app-cmd { background: #0c0c0c; font-family: 'Consolas', monospace; padding: 10px; overflow-y: auto; width: 100%; height: 100%; }
.cmd-line { display: flex; gap: 10px; margin-top: 5px;}
.cmd-line input { flex: 1; background: transparent; border: none; color: white; font-family: 'Consolas', monospace; outline: none; }

.app-calc { display: flex; flex-direction: column; height: 100%; padding: 15px; background: #1e1e24;}
#calc-res { text-align: right; font-size: 36px; padding: 10px; background: transparent; border: none; color: white; outline: none; margin-bottom: 10px;}
.calc-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.calc-grid button { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 8px; color: white; font-size: 20px; cursor: pointer; transition: 0.1s;}
.calc-grid button:hover { background: rgba(255,255,255,0.1); }
.calc-grid button:active { background: rgba(255,255,255,0.2); }

.app-paint { 
    display: flex; flex-direction: column; height: 100%; 
    background: #2d2d35; overflow: auto; 
}.paint-tools { padding: 10px; background: rgba(0,0,0,0.2); display: flex; gap: 15px; align-items: center; border-bottom: 1px solid var(--glass-border);}
#paint-canvas { 
    background: white; cursor: crosshair; display: block; 
}
.app-media { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; background: #000; }
.app-media img, .app-media video { max-width: 100%; max-height: 100%; object-fit: contain; }