/* === 1. THEME ENGINE === */
:root {
    /* Background & Glass Effects */
    --wallpaper: linear-gradient(to bottom right, #ffffff 0%, #e0e0e0 100%); 
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
    
    /* Text & Colors */
    --text-color: #000000;
    --text-subtle: #444444;
    --btn-bg: #000000;
    --btn-text: #ffffff;
    
    /* Interface */
    --dock-bg: rgba(240, 240, 240, 0.7);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --icon-size: 100px; 
}

/* Dark Mode Support (Optional) */
body.dark-mode {
    --wallpaper: linear-gradient(to bottom right, #232526 0%, #414345 100%);
    --glass-bg: rgba(30, 30, 30, 0.9);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-color: #ffffff;
    --text-subtle: #bbbbbb;
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --dock-bg: rgba(0, 0, 0, 0.6);
}

/* === 2. GENERAL LAYOUT === */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--wallpaper);
    background-size: cover;
    height: 100vh;
    color: var(--text-color);
    overflow: hidden;
    user-select: none;
}

.hidden { display: none !important; }

/* === 3. LOGIN SCREEN === */
#login-screen {
    display: flex; justify-content: center; align-items: center; 
    height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; z-index: 9999;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    padding: 60px 40px; 
    border-radius: 24px; 
    width: 380px; 
    text-align: center;
    box-shadow: var(--shadow);
}

h1 { font-size: 34px; font-weight: 800; margin-bottom: 40px; letter-spacing: -1px; }

input {
    width: 100%; padding: 16px; margin: 10px 0; border-radius: 12px;
    border: 1px solid #ccc; background: rgba(255,255,255,0.8);
    color: #000; outline: none; box-sizing: border-box; font-size: 16px;
}

#auth-btn {
    width: 100%; padding: 18px; margin-top: 30px; border-radius: 12px;
    border: none; background: var(--btn-bg); color: var(--btn-text);
    font-weight: 800; font-size: 15px; text-transform: uppercase; cursor: pointer;
}
#auth-btn:hover { opacity: 0.9; }

.toggle-text { margin-top: 20px; font-size: 14px; color: var(--text-subtle); }
.toggle-text a { font-weight: bold; cursor: pointer; text-decoration: underline; margin-left: 5px; }

/* === 4. DESKTOP & TOP BAR === */
#top-bar {
    height: 60px; padding: 0 30px;
    display: flex; justify-content: space-between; align-items: center;
    background: transparent; z-index: 10; position: relative;
}

.os-title { font-size: 20px; font-weight: 700; color: var(--text-color); }

.right-menu { display: flex; align-items: center; gap: 20px; font-weight: 600; font-size: 14px; }

#user-menu-container {
    cursor: pointer; background: rgba(255, 255, 255, 0.3);
    padding: 8px 12px; border-radius: 8px; position: relative;
}

#user-dropdown {
    position: absolute; top: 120%; right: 0; width: 140px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 12px; box-shadow: var(--shadow);
    padding: 10px; z-index: 200;
}
#logout-btn { color: #ff4757; cursor: pointer; display: flex; align-items: center; gap: 8px; }

/* === 5. APP ICONS === */
#desktop-grid {
    padding: 40px; display: grid; 
    grid-template-columns: repeat(auto-fill, 130px); gap: 30px;
}

.app-icon {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; transition: transform 0.2s;
}
.app-icon:hover { transform: scale(1.05); }

.icon-box {
    width: var(--icon-size); height: var(--icon-size);
    border-radius: 24px; display: flex; justify-content: center; align-items: center;
    font-size: 40px; box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.app-label {
    margin-top: 12px; font-size: 15px; font-weight: 600; color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* === 6. WINDOWS === */
.os-window {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--glass-bg); backdrop-filter: blur(40px);
    border-radius: 20px; border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    display: flex; flex-direction: column; overflow: hidden;
    animation: popIn 0.3s ease-out; z-index: 100;
}

@keyframes popIn { from { opacity: 0; transform: translate(-50%, -40%) scale(0.95); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.window-header {
    height: 50px; background: rgba(0,0,0,0.03);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 25px; border-bottom: 1px solid var(--glass-border);
}
.window-title { font-weight: 700; font-size: 16px; }
.close-win-btn { border: none; background: transparent; font-size: 28px; cursor: pointer; line-height: 1; }

.window-content { padding: 30px; }

/* === 7. FILE VAULT SPECIFIC === */
#vault-file-list::-webkit-scrollbar { width: 6px; }
#vault-file-list::-webkit-scrollbar-track { background: transparent; }
#vault-file-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
#vault-file-list div:hover { background: rgba(0,0,0,0.05); border-radius: 6px; }

/* === 8. DOCK === */
#dock {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 60%; height: 80px; background: var(--dock-bg);
    border-radius: 24px; backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}