/* JerOS Style Sheet */

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

:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #12121a;
    --bg-glass: rgba(16, 16, 26, 0.72);
    --bg-window: rgba(20, 20, 30, 0.75);
    --bg-menu: rgba(14, 14, 22, 0.92);
    --bg-taskbar: rgba(10, 10, 20, 0.72);
    --bg-notification: rgba(16, 16, 24, 0.92);
    --bg-context: rgba(16, 16, 24, 0.92);
    --bg-card: rgba(255,255,255,0.02);
    --bg-input: rgba(255,255,255,0.02);
    --bg-textarea: rgba(0,0,0,0.3);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-input: rgba(255,255,255,0.04);
    --text-primary: #f0f2f8;
    --text-secondary: #9a9ab0;
    --text-muted: #6a6a7e;
    --accent: #7a9cff;
    --accent-glow: rgba(122, 156, 255, 0.2);
    --shadow-window: 0 25px 50px rgba(0,0,0,0.5);
    --shadow-glass: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-menu: 0 20px 60px rgba(0,0,0,0.8);
    --shadow-notif: 0 12px 40px rgba(0,0,0,0.5);
    --radius-window: 16px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, sans-serif;
    /* Terminal prompt color - dark mode (Green) */
    --prompt-color: #00ff00;
}

.light-mode {
    --bg-primary: #eef0f5;
    --bg-secondary: #d5d8e0;
    --bg-glass: rgba(255,255,255,0.7);
    --bg-window: rgba(255,255,255,0.85);
    --bg-menu: rgba(255,255,255,0.92);
    --bg-taskbar: rgba(255,255,255,0.75);
    --bg-notification: rgba(255,255,255,0.92);
    --bg-context: rgba(255,255,255,0.92);
    --bg-card: rgba(0,0,0,0.02);
    --bg-input: rgba(0,0,0,0.03);
    --bg-textarea: rgba(0,0,0,0.05);
    --border-glass: rgba(0,0,0,0.06);
    --border-input: rgba(0,0,0,0.08);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #7a7a8e;
    --accent: #5f7cff;
    --accent-glow: rgba(95,124,255,0.15);
    --shadow-window: 0 25px 50px rgba(0,0,0,0.15);
    --shadow-glass: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-menu: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-notif: 0 12px 40px rgba(0,0,0,0.1);
    /* Terminal prompt color - light mode (Dark Gray) */
    --prompt-color: #333333;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* LOGO */
.jeros-logo { width: 48px; height: 48px; }
.jeros-logo .bg-shape { fill: var(--accent); opacity: 0.15; rx: 14; }
.jeros-logo .ring { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 80 100; animation: orbitSpin 8s linear infinite; }
.jeros-logo .j-letter { fill: var(--text-primary); font-family: 'Inter', sans-serif; font-weight: 700; font-size: 24px; }
.jeros-logo .dot { fill: var(--text-primary); opacity: 0.7; }
@keyframes orbitSpin {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -200; }
}
.logo-small { width: 28px; height: 28px; }
.logo-medium { width: 36px; height: 36px; }
.logo-large { width: 56px; height: 56px; }

/* BOOT */
#boot {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    gap: 20px;
}
#boot.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#boot .boot-title { font-size: 3rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
#boot .boot-title span { color: var(--accent); }
#boot .loader { width: 200px; height: 2px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
#boot .loader .bar { width: 0%; height: 100%; background: var(--accent); animation: bootLoad 1.6s ease forwards; }
@keyframes bootLoad {
    0% { width: 0%; }
    100% { width: 100%; }
}
#boot .status { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; }

/* DESKTOP */
#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    transition: background 0.5s ease;
}
#desktop::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.008) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.008) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.wallpaper-1 { background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); }
.wallpaper-2 { background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); }
.wallpaper-3 { background: linear-gradient(135deg, #2d1b69, #11998e, #38ef7d); }

/* ICONS — Bigger, Better Visibility */
#icons {
    position: absolute;
    top: 28px;
    left: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 5;
}
.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 92px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    transition: 0.25s ease;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.55rem;
    font-weight: 600;
    gap: 6px;
    padding: 8px;
    text-align: center;
    opacity: 0.85;
}
.icon-item .ico {
    font-size: 2.8rem;
    opacity: 0.95;
    color: var(--accent);
}
.icon-item .lbl {
    font-size: 0.7rem;
    font-weight: 600;
    color: #f0f2f8;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    opacity: 1;
}
.icon-item:hover {
    background: var(--bg-card);
    border-color: var(--border-glass);
    color: var(--text-primary);
    opacity: 1;
    transform: translateY(-4px);
}
.icon-item:active { transform: scale(0.95); }

/* Light Mode — Icon labels white (ensured) */
.light-mode .icon-item .lbl {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* TASKBAR */
#taskbar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 94%;
    max-width: 1100px;
    height: 56px;
    background: var(--bg-taskbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 8px;
    z-index: 999;
    box-shadow: var(--shadow-glass);
}
#taskbar .logo-area { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 8px; border-radius: var(--radius-sm); transition: 0.2s ease; cursor: pointer; }
#taskbar .logo-area:hover { background: var(--bg-card); }
#taskbar .logo-text { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.3px; color: var(--text-primary); }
#taskbar .logo-text span { color: var(--text-muted); font-weight: 400; }
#taskbar-center { flex: 1; display: flex; justify-content: center; color: var(--text-muted); font-size: 0.6rem; font-weight: 400; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.4; }
#tray { display: flex; align-items: center; gap: 14px; color: var(--text-secondary); font-size: 0.75rem; font-weight: 500; padding-left: 14px; border-left: 1px solid var(--border-glass); }
#tray .dt { text-align: right; line-height: 1.2; }
#tray .tm { font-size: 0.8rem; color: var(--text-primary); }
#tray .dt2 { font-size: 0.55rem; color: var(--text-muted); }

/* SYSTEM TRAY */
#system-tray {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-left: 12px;
    border-left: 1px solid var(--border-glass);
}
.tray-icon {
    cursor: pointer;
    opacity: 0.8;
    transition: 0.2s;
    font-size: 0.9rem;
}
.tray-icon:hover {
    opacity: 1;
    color: var(--accent);
}

/* TASKBAR APPS */
#taskbar-apps {
    display: flex;
    flex: 1;
    gap: 4px;
    overflow-x: auto;
    padding: 0 6px;
    height: 100%;
    align-items: center;
    scrollbar-width: thin;
}
#taskbar-apps::-webkit-scrollbar { height: 4px; }
#taskbar-apps::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.taskbar-app {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    height: 30px;
    border-radius: 6px 4px 6px 4px;
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: 0.2s ease;
    cursor: pointer;
    padding: 4px 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    gap: 6px;
    font-weight: 500;
    position: relative;
}
.taskbar-app:hover { background: var(--bg-glass); color: var(--text-primary); }
.taskbar-app.active { background: var(--accent-glow); color: var(--text-primary); border-color: var(--accent); }
.taskbar-app .close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0 2px;
    margin-left: 4px;
}
.taskbar-app .close-btn:hover { color: #e74c6f; }

/* TASKBAR RIGHT-CLICK MENU */
#taskbar-context-menu {
    position: fixed;
    bottom: 70px;
    background: var(--bg-context);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: var(--shadow-menu);
    padding: 6px 0;
    min-width: 180px;
    z-index: 9998;
    display: none;
}
#taskbar-context-menu.open { display: block; }

/* START MENU */
#menu {
    position: absolute;
    bottom: 76px;
    left: 20px;
    width: 380px;
    max-height: 440px;
    background: var(--bg-menu);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-menu);
    padding: 20px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: menuPop 0.15s ease;
}
#menu.open { display: flex; }
@keyframes menuPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
#menu .mhead { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 0.8rem; color: var(--text-primary); margin-bottom: 14px; }
#menu .search { background: var(--bg-input); border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-primary); font-size: 0.8rem; font-family: var(--font); outline: none; margin-bottom: 14px; transition: 0.2s ease; }
#menu .search:focus { border-color: var(--accent); background: var(--bg-card); }
#menu .search::placeholder { color: var(--text-muted); }
#menu .grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; overflow-y: auto; flex: 1; }
#menu .grid .app { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: var(--radius-sm); background: transparent; border: 1px solid transparent; cursor: pointer; transition: 0.2s ease; color: var(--text-secondary); font-size: 0.6rem; font-weight: 500; }
#menu .grid .app:hover { background: var(--bg-card); border-color: var(--border-glass); color: var(--text-primary); }
#menu .grid .app .ico { font-size: 1.6rem; opacity: 0.8; width: 1.6rem; text-align: center; }

/* KEYBOARD SHORTCUTS POPUP */
#shortcuts-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
#shortcuts-popup.open { display: flex; }
.shortcuts-content {
    background: var(--bg-menu);
    backdrop-filter: blur(40px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    min-width: 360px;
    box-shadow: var(--shadow-menu);
    text-align: center;
}

/* WINDOWS */
.window {
    position: absolute;
    min-width: 320px;
    min-height: 180px;
    background: var(--bg-window);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-window);
    box-shadow: var(--shadow-window);
    display: flex;
    flex-direction: column;
    animation: windowOpen 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
}
@keyframes windowOpen {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.window.closing { animation: windowClose 0.15s ease forwards; }
@keyframes windowClose {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95) translateY(6px); }
}
.window-header {
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    flex-shrink: 0;
    border-radius: var(--radius-window) var(--radius-window) 0 0;
}
.window-header:active { cursor: grabbing; }
.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}
.window-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.7;
}
.window-controls {
    display: flex;
    gap: 6px;
}
.window-controls button {
    width: 26px;
    height: 26px;
    border-radius: 6px 4px 6px 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    justify-content: center;
}
.window-controls button:hover { background: var(--bg-glass); color: var(--text-primary); }
.window-controls .close:hover { background: #e74c6f; color: #fff; border-color: #e74c6f; }
.window-body {
    flex: 1;
    padding: 0;
    overflow: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
}
.window-body::-webkit-scrollbar { width: 4px; }
.window-body::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 8px; }

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 10;
}
.resize-handle::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    opacity: 0.5;
}

.wallpaper-option {
    display: inline-block;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s ease;
}
.wallpaper-option:hover { border-color: var(--accent); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (max-width: 600px) {
    #taskbar { width: 96%; padding: 0 12px; height: 50px; }
    #taskbar .logo-text { display: none; }
    #tray .dt2 { display: none; }
    #menu { width: 90%; left: 5%; bottom: 70px; }
    .icon-item { width: 70px; height: 74px; }
    .icon-item .ico { font-size: 2.2rem; }
    .icon-item .lbl { font-size: 0.6rem; }
    #boot .boot-title { font-size: 2rem; }
    .window { min-width: 260px; }
    #system-tray { display: none; }
}

/* FILE MANAGER */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-secondary);
    font-size: 0.7rem;
    position: relative;
}
.file-item:hover { background: var(--bg-glass); border-color: var(--border-glass); }
.file-item .file-icon { font-size: 2rem; }
.file-item .file-name { margin-top: 4px; word-break: break-all; text-align: center; }
.file-item .file-delete {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(231, 76, 111, 0.2);
    border: 1px solid #e74c6f;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    color: #e74c6f;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}
.file-item:hover .file-delete { display: flex; }
.file-item .file-delete:hover { background: #e74c6f; color: #fff; }

/* CALCULATOR — History Sidebar */
.calc-wrapper {
    display: flex;
    height: 100%;
    flex: 1;
}
.calc-main {
    flex: 2;
    display: flex;
    flex-direction: column;
    padding: 12px;
}
.calc-history-side {
    flex: 1;
    border-left: 1px solid var(--border-glass);
    padding: 12px;
    overflow-y: auto;
    max-height: 100%;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.calc-history-side .hist-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.calc-history-side .hist-title .clear-history {
    background: none;
    border: none;
    color: #e74c6f;
    cursor: pointer;
    font-size: 0.6rem;
}
.calc-history-side .hist-title .clear-history:hover { text-decoration: underline; }
.calc-history-side .hist-entry {
    padding: 3px 0;
    border-bottom: 1px solid var(--border-glass);
    font-family: monospace;
    font-size: 0.7rem;
}
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}
.calc-grid .display {
    grid-column: span 4;
    background: var(--bg-textarea);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-align: right;
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calc-grid button {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font);
    text-align: center;
}
.calc-grid button:hover { background: var(--bg-glass); }
.calc-grid .op { color: var(--accent); }
.calc-grid .eq { background: var(--accent); color: #fff; }
.calc-grid .eq:hover { background: #6a8aff; }

/* NOTES */
.notes-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--bg-textarea);
}
.notes-body textarea {
    width: 100%;
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 12px;
    font-family: var(--font);
    font-size: 0.9rem;
    resize: none;
    overflow: auto;
    outline: none;
    min-height: unset;
}
.notes-body .note-actions {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    flex-shrink: 0;
    background: var(--bg-glass);
    border-top: 1px solid var(--border-glass);
}
.notes-body .note-actions button {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 4px 14px;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    transition: 0.2s;
    line-height: 1.5;
    height: 28px;
}
.notes-body .note-actions button:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

/* NOTIFICATIONS */
#notification-container {
    position: fixed;
    top: 20px;
    z-index: 9999;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
.notification {
    background: var(--bg-notification);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: var(--shadow-notif);
    animation: notifIn 0.3s ease;
    color: var(--text-primary);
    font-size: 0.85rem;
}
.notification .notif-title { font-weight: 600; font-size: 0.9rem; }
.notification .notif-body { color: var(--text-secondary); margin-top: 2px; }
.notification .notif-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}
@keyframes notifIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.notification-out { animation: notifOut 0.3s ease forwards; }
@keyframes notifOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* CONTEXT MENU */
#context-menu {
    position: fixed;
    background: var(--bg-context);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: var(--shadow-menu);
    padding: 6px 0;
    min-width: 180px;
    z-index: 9998;
    display: none;
    animation: menuPop 0.12s ease;
}
#context-menu.open { display: block; }
.ctx-item {
    padding: 8px 18px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ctx-item:hover { background: var(--bg-card); color: var(--text-primary); }
.ctx-divider { height: 1px; background: var(--border-glass); margin: 4px 12px; }

/* TERMINAL PROMPT COLOR */
.term-prompt {
    color: var(--prompt-color);
    font-weight: bold;
}