/* LOCK SCREEN */
.lock-screen {
    position: fixed; inset: 0; z-index: var(--z-lock);
    background: linear-gradient(135deg, #0b1220 0%, #1a233a 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 80px 24px 40px; color: white;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    cursor: pointer;
}
.lock-screen.unlocked { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.lock-content { text-align: center; }
.lock-time { font-size: 72px; font-weight: 200; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.lock-date { font-size: 18px; font-weight: 400; opacity: 0.8; margin-top: 8px; }
.lock-hint { font-size: 13px; opacity: 0.5; margin-top: 40px; animation: pulse 2s infinite; }
.lock-bottom { display: flex; gap: 40px; }
.lock-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* STATUS BAR */
.status-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-dock);
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; font-size: 13px; font-weight: 600; color: white;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
    pointer-events: none;
}
.status-left, .status-right { display: flex; align-items: center; gap: 6px; }
.status-center { display: flex; gap: 4px; }

/* WORKSPACE */
.os-section {
    position: relative; width: 100%; min-height: 100vh; min-height: 100dvh;
    font-family: 'Roboto', 'Inter', system-ui, sans-serif; overflow: hidden;
    display: flex; flex-direction: column;
}
.os-wallpaper {
    position: absolute; inset: 0; z-index: 0;
    background-size: cover; background-position: center;
    transition: background-image 0.8s ease;
}
.os-wallpaper::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.2); pointer-events: none;
}

/* SEARCH */
.launcher-search-bar {
    position: relative; z-index: 10; display: flex; align-items: center; gap: 12px;
    max-width: 560px; width: 90%; margin: 48px auto 0; padding: 14px 20px;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(24px);
    border-radius: var(--radius-full); border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-md); transition: var(--transition-base);
}
.launcher-search-bar:focus-within { transform: scale(1.02); box-shadow: var(--shadow-lg); background: rgba(255, 255, 255, 0.95); }
.launcher-search-bar input { flex: 1; font-size: 15px; color: var(--color-ink); outline: none; }
.launcher-search-bar .material-symbols-rounded { color: var(--color-muted); font-size: 22px; }

/* GRID */
.desktop-canvas {
    position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column;
    align-items: center; padding: 24px 24px 120px; overflow-y: auto; scrollbar-width: none;
}
.desktop-canvas::-webkit-scrollbar { display: none; }
.apps-grid {
    display: grid; grid-template-columns: repeat(4, 76px); justify-content: center;
    gap: 28px 24px; padding: 24px; width: 100%; max-width: 420px;
}

/* APPS */
.os-app {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; user-select: none; touch-action: none; border-radius: var(--radius-md);
    padding: 8px; transition: transform var(--transition-fast), background var(--transition-fast);
    position: relative; width: 76px;
}
.os-app:hover { background: rgba(255, 255, 255, 0.15); }
.os-app:active { transform: scale(0.92); }
.os-app.dragging { opacity: 0.8; transform: scale(1.05); z-index: 100; }

.app-icon {
    width: 56px; height: 56px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; overflow: hidden; position: relative;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon .material-symbols-rounded { font-size: 28px; color: var(--color-ink); }
.app-label {
    font-size: 12px; font-weight: 500; color: #ffffff; text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); max-width: 76px; line-height: 1.2;
    pointer-events: none; word-wrap: break-word;
}

/* DOCK */
.os-dock {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 16px; padding: 14px 20px; border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5); box-shadow: var(--shadow-lg);
    z-index: var(--z-dock);
}
.dock-item {
    width: 52px; height: 52px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform var(--transition-spring);
    background: rgba(255, 255, 255, 0.6); position: relative; overflow: hidden;
}
.dock-item:hover { transform: scale(1.15) translateY(-6px); background: rgba(255, 255, 255, 0.95); }
.dock-item:active { transform: scale(0.9); }
.dock-item img, .dock-item .material-symbols-rounded { width: 28px; height: 28px; object-fit: contain; font-size: 28px; color: var(--color-ink); }

/* RIPPLE EFFECT */
.ripple {
    position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.4);
    transform: scale(0); animation: ripple-anim 0.6s linear; pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* TRASH BIN */
.trash-bin {
    position: fixed; right: 24px; bottom: 100px; display: flex; flex-direction: column;
    align-items: center; gap: 6px; padding: 12px; border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.15); backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.3); cursor: pointer;
    transition: var(--transition-base); z-index: 90; opacity: 0; pointer-events: none;
}
.trash-bin.visible { opacity: 1; pointer-events: auto; }
.trash-bin.drag-over { background: rgba(239, 68, 68, 0.4); transform: scale(1.1); }
.trash-bin .material-symbols-rounded { font-size: 28px; color: #ef4444; }
.trash-label { font-size: 11px; color: #ef4444; font-weight: 600; }

/* FOLDER PREVIEW */
.folder-preview-grid {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
    width: 56px; height: 56px; border-radius: 18px; overflow: hidden;
    background: rgba(255,255,255,0.9); box-shadow: var(--shadow-sm);
}
.folder-preview-item { width: 100%; height: 100%; object-fit: cover; border: 1px solid rgba(255,255,255,0.8); }

/* EDIT MODE SHAKE */
.os-section.edit-mode .os-app:not(.dragging) { animation: app-shake 0.3s ease-in-out infinite alternate; }
@keyframes app-shake { 0% { transform: rotate(-1.5deg); } 100% { transform: rotate(1.5deg); } }

/* CONTEXT MENU */
.context-menu {
    position: fixed; z-index: 5000; min-width: 200px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(24px);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: 8px 0; opacity: 0; transform: scale(0.9);
    transition: all var(--transition-fast); pointer-events: none;
}
.context-menu.active { opacity: 1; transform: scale(1); pointer-events: auto; }
.context-menu-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    font-size: 14px; color: var(--color-ink); cursor: pointer; transition: background 0.1s;
}
.context-menu-item:hover { background: rgba(11, 132, 255, 0.08); }
.context-menu-item .material-symbols-rounded { font-size: 20px; color: var(--color-muted); }

/* MODALS */
.folder-modal, .system-app-modal {
    position: fixed; inset: 0; z-index: var(--z-modal);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.folder-modal.active, .system-app-modal.active { opacity: 1; pointer-events: auto; }
.folder-modal-backdrop, .system-app-backdrop {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.folder-modal-content, .system-app-window {
    position: relative; width: 90%; max-width: 480px; max-height: 80vh;
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(32px);
    border-radius: var(--radius-lg); border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg); transform: scale(0.92) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    overflow: hidden; display: flex; flex-direction: column;
}
.folder-modal.active .folder-modal-content, .system-app-modal.active .system-app-window {
    transform: scale(1) translateY(0); opacity: 1;
}
.system-app-header, .folder-modal-header {
    display: flex; align-items: center; gap: 12px; padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.system-app-header .material-symbols-rounded, .folder-modal-header .material-symbols-rounded {
    font-size: 24px; color: var(--color-accent);
}
.system-app-header h3, .folder-modal-header h3 {
    flex: 1; margin: 0; font-size: 18px; font-weight: 600; color: var(--color-ink);
}
.system-app-close, .folder-modal-close {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, 0.05); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.system-app-close:hover, .folder-modal-close:hover { background: rgba(0, 0, 0, 0.1); }
.system-app-body, .folder-modal-grid {
    flex: 1; overflow-y: auto; padding: 24px;
}
.folder-modal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 16px; justify-items: center;
}

/* TOAST */
.toast-notification {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 30, 0.9); color: white; padding: 12px 24px;
    border-radius: var(--radius-full); font-size: 14px; font-weight: 500;
    opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 9999;
    backdrop-filter: blur(10px);
}
.toast-notification.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .apps-grid { grid-template-columns: repeat(4, 68px); gap: 20px 16px; }
    .os-dock { bottom: 16px; padding: 12px 16px; gap: 12px; }
    .dock-item { width: 48px; height: 48px; }
    .lock-time { font-size: 56px; }
}