/* --- CORE VARIABLES --- */
:root {
    --bg-color: #050505;
    --panel-bg: rgba(10, 10, 15, 0.95);
    --panel-border: #333;

    --window-bg: rgba(13, 13, 18, 0.98);
    --window-header-bg: #1a1a24;

    --primary-color: #00f3ff;
    /* Cyan Neon */
    --secondary-color: #ff0055;
    /* Pink Neon */
    --tertiary-color: #10b981;
    /* Emerald Neon */
    --text-color: #e0e0e0;
    --dim-text: #888;

    --border-color: #444;
    --highlight-bg: rgba(0, 243, 255, 0.15);

    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    user-select: none;
}

/* --- CRT OVERLAY EFFECTS --- */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

.vignette {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.6) 100%);
}

#background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

/* --- BOOT SEQUENCE --- */
#boot-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    padding: 20px;
    font-family: var(--font-mono);
    color: var(--primary-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Terminal style bottom fill */
}

#boot-log {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 0 5px var(--primary-color);
}

/* --- LOGIN SCREEN --- */
#login-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#login-box {
    background: var(--window-bg);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
    padding: 40px;
    width: 320px;
    text-align: center;
    position: relative;
}

#login-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid var(--primary-color);
    opacity: 0.3;
    pointer-events: none;
    filter: blur(2px);
}

.glitch {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 2px 2px 0px var(--secondary-color);
    animation: glitch-anim 2s infinite;
}

@keyframes glitch-anim {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

.login-status {
    color: var(--secondary-color);
    font-family: var(--font-mono);
    font-size: 12px;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.login-input-group {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 20px;
    background: rgba(0, 243, 255, 0.05);
}

.prompt-char {
    padding: 10px;
    color: var(--primary-color);
    font-weight: bold;
    font-family: var(--font-mono);
}

#username-input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    padding: 10px 0;
    font-family: var(--font-mono);
    font-size: 14px;
}

#username-input:focus {
    outline: none;
}

#login-button {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}

#login-button:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--primary-color);
}

/* --- PANELS --- */
.panel {
    background: var(--panel-bg);
    height: 32px;
    position: fixed;
    width: 100%;
    z-index: 5000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    font-size: 13px;
    padding: 0 5px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

#top-panel {
    top: 0;
}

#bottom-panel {
    bottom: 0;
    border-top: 1px solid var(--panel-border);
    border-bottom: none;
}

.panel-menu-container {
    display: flex;
    height: 100%;
}

.panel-menu {
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.panel-menu:hover,
.panel-menu.menu-open {
    background: var(--highlight-bg);
    color: var(--primary-color);
}

.menu-label {
    font-weight: 500;
}

.system-tray {
    display: flex;
    gap: 15px;
    align-items: center;
    padding-right: 10px;
    font-family: var(--font-mono);
    color: var(--primary-color);
    font-size: 12px;
}

/* --- MENUS --- */
.menu {
    position: absolute;
    top: 32px;
    left: 0;
    background: var(--window-bg);
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--primary-color);
    min-width: 220px;
    display: none;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.8);
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-color);
    position: relative;
}

.menu li:hover {
    background: var(--highlight-bg);
    color: var(--primary-color);
}

.menu hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 4px 0;
}

.right-icon {
    position: absolute;
    right: 10px;
    font-size: 10px;
}

.submenu {
    left: 100%;
    top: -5px;
    margin-left: -2px;
    display: none;
}

.has-submenu:hover .submenu {
    display: block;
}

/* --- WINDOWS --- */
.app-window {
    position: absolute;
    background: var(--window-bg);
    border: 1px solid var(--border-color);
    border-top: 1px solid var(--primary-color);
    /* Cyberpunk accent */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    min-width: 200px;
    min-height: 150px;
    overflow: hidden;
    /* transition: box-shadow 0.2s; - Remove transition for snappy drag */
}

.app-window.active-window {
    border-color: #666;
    border-top-color: #fff;
    box-shadow: 0 10px 50px rgba(0, 243, 255, 0.15);
    z-index: 100;
}

.window-title-bar {
    background: var(--window-header-bg);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
    /* Changed from move to let JS handle drag area */
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

.window-title-bar .title-drag-area {
    flex-grow: 1;
    cursor: move;
    height: 100%;
    display: flex;
    align-items: center;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    background: transparent;
    border: none;
    color: var(--dim-text);
    cursor: pointer;
    width: 24px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.title-bar-controls button:hover {
    background: #333;
    color: #fff;
}

.title-bar-controls button.close-btn:hover {
    background: var(--secondary-color);
}

.window-content {
    flex-grow: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.resize-handle {
    position: absolute;
    z-index: 1000;
}

.resize-r {
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: ew-resize;
}

.resize-b {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    cursor: ns-resize;
}

.resize-br {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: nwse-resize;
}

/* --- APP SPECIFIC STYLES --- */
.terminal-content {
    background-color: #050505;
    font-family: var(--font-mono);
    padding: 10px;
    overflow-y: auto;
    color: #ccc;
    font-size: 13px;
}

.terminal-line {
    margin-bottom: 2px;
    word-wrap: break-word;
}

.terminal-prompt {
    color: var(--secondary-color);
    margin-right: 8px;
}

.terminal-input-container {
    display: flex;
}

.terminal-input {
    color: var(--primary-color);
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none;
    margin: 0;
    padding: 0;
}

.file-browser-content {
    padding: 10px;
    overflow-y: auto;
}

.file-nav {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-nav button {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 2px;
}

.file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.file-item {
    width: 80px;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #444;
}

.file-item i {
    font-size: 32px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.file-item[data-type="file"] i {
    color: #aaa;
}

.file-item-name {
    font-size: 12px;
    word-break: break-word;
    margin-top: 5px;
}

.settings-content {
    padding: 20px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-top: 0;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--dim-text);
}

.utility-button {
    background: #222;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 11px;
}

.utility-button:hover {
    background: var(--primary-color);
    color: #000;
}

/* --- TASKBAR --- */
#taskbar-items {
    flex-grow: 1;
    display: flex;
    gap: 4px;
    padding: 0 5px;
    overflow-x: auto;
}

.task-item {
    padding: 0 10px;
    margin-top: 4px;
    height: 24px;
    background: #222;
    border-bottom: 2px solid transparent;
    color: #888;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    max-width: 160px;
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
}

.task-item i {
    margin-right: 6px;
    font-size: 10px;
}

.task-item:hover {
    background: #333;
    color: #ccc;
}

.task-item.active {
    background: #2a2a2a;
    border-bottom: 2px solid var(--primary-color);
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.task-item.minimized {
    opacity: 0.5;
    font-style: italic;
}

/* --- DESKTOP ICONS --- */
#desktop {
    position: absolute;
    top: 32px;
    bottom: 32px;
    width: 100%;
    z-index: 1;
}

.desktop-icon {
    position: absolute;
    width: 74px;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border: 1px solid transparent;
    color: var(--text-color);
    text-shadow: 0 1px 2px #000;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.desktop-icon.selected {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
}

.desktop-icon i {
    font-size: 36px;
    margin-bottom: 5px;
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.3));
}

.desktop-icon[data-type="file"] i {
    color: #ddd;
}

/* --- SELECTION BOX --- */
#selection-box {
    position: absolute;
    border: 1px solid var(--primary-color);
    background-color: rgba(0, 243, 255, 0.1);
    display: none;
    z-index: 9999;
    pointer-events: none;
}

#trash-bin {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 32px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#trash-bin:hover {
    opacity: 1;
    color: #f00;
}
/* --- PROFESSIONAL MODE --- */
#professional-mode {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a24 0%, #050505 100%);
    z-index: 6000; /* Above Desktop and Panels, below Boot/Login */
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

.prof-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
}

.prof-nav .logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.prof-nav .links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
    transition: color 0.2s;
}

.prof-nav .links a:hover {
    color: var(--primary-color);
}

.prof-hero {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.prof-hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.prof-hero p {
    font-size: 18px;
    color: #aaa;
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.prof-cta {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px 40px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.prof-cta:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

/* --- NOTIFICATION TOAST --- */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(13, 13, 18, 0.95);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    padding: 20px;
    z-index: 7000;
    width: 300px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notif-content {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.notif-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.notif-actions button {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 12px;
}

.notif-actions button:hover {
    border-color: #fff;
    color: #fff;
}

#btn-mode-yes {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#btn-mode-yes:hover {
    background: var(--primary-color);
    color: #000;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    z-index: 8000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: var(--window-bg);
    border: 1px solid #444;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.modal-box h2 {
    color: var(--text-color);
    margin-top: 0;
}

.modal-box p {
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions button {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-actions button:hover {
    border-color: #fff;
    color: #fff;
}

#btn-disc-accept {
    background: #ccc;
    color: #000;
    border-color: #ccc;
}

#btn-disc-accept:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}
