:root {
    /* Core Colors */
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --accent-color: #0078d4;

    /* Component Backgrounds */
    --taskbar-bg: rgba(20, 20, 20, 0.85);
    --window-bg: #2d2d2d;
    --start-menu-bg: rgba(30, 30, 30, 0.95);
    --login-bg: rgba(0, 0, 0, 0.8);
    --input-bg: rgba(255, 255, 255, 0.1);

    /* Interactive States */
    --hover-bg: rgba(255, 255, 255, 0.1);
    --active-bg: rgba(255, 255, 255, 0.15);

    /* Borders & Dividers */
    --border-color: rgba(255, 255, 255, 0.1);

    /* Effects */
    --border-radius: 8px;
    --glass-blur: 10px;
    --shadow-color: rgba(0, 0, 0, 0.5);

    /* Text Shadows */
    --text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#desktop-icons {
    position: absolute;
    top: 68px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 20px;
    pointer-events: auto;
    z-index: 10;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background 0.2s;
    width: 80px;
    text-align: center;
}

.desktop-icon:hover {
    background: var(--hover-bg);
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.desktop-icon span {
    font-size: 12px;
    text-shadow: var(--text-shadow);
    word-break: break-word;
    line-height: 1.2;
}

#window-area {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    pointer-events: none;
    z-index: 20;
}

#taskbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: var(--taskbar-bg);
    backdrop-filter: blur(var(--glass-blur));
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

#start-button {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

#start-button:hover,
#start-button.active {
    background: var(--hover-bg);
}

.logo {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
}

#taskbar-apps {
    flex: 1;
    display: flex;
    margin-left: 10px;
    gap: 5px;
}

.taskbar-item {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    max-width: 150px;
    transition: background 0.2s;
}

.taskbar-item:hover,
.taskbar-item.active {
    background: var(--active-bg);
}

.taskbar-item img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.taskbar-item span {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#system-tray {
    padding: 0 10px;
    font-size: 12px;
}

#start-menu {
    position: absolute;
    top: 48px;
    left: 10px;
    width: 400px;
    height: 500px;
    background: var(--start-menu-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 1001;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: top left;
}

#start-menu.hidden {
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: none;
    background: var(--input-bg);
    color: var(--text-color);
    margin-bottom: 20px;
}

.app-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    overflow-y: auto;
}

.start-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
}

.start-menu-item:hover {
    background: var(--hover-bg);
}

.start-menu-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
}

.start-menu-item span {
    font-size: 11px;
    text-align: center;
}

.user-profile {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#theme-selector {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
}

#theme-selector option {
    background: var(--window-bg);
    color: var(--text-color);
}

#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--login-bg);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#login-screen.hidden {
    display: none;
}

.login-box {
    background: var(--window-bg);
    padding: 40px;
    border-radius: 8px;
    width: 300px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: var(--input-bg);
    border: none;
    color: var(--text-color);
    border-radius: 4px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: var(--accent-color);
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

/* Window Styles */
.window {
    position: absolute;
    background: var(--window-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
    min-height: 200px;
    border: 1px solid var(--border-color);
    pointer-events: auto;
}

.window-header {
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: default;
}

.window-title {
    font-size: 12px;
    font-weight: 500;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close-btn {
    background: #ff5f56;
}

.minimize-btn {
    background: #ffbd2e;
}

.maximize-btn {
    background: #27c93f;
}

.window-content {
    flex: 1;
    position: relative;
    background: white;
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 3px;
    z-index: 1001;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: bottom left;
}

#start-menu.hidden {
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: none;
    background: var(--input-bg);
    color: var(--text-color);
    margin-bottom: 20px;
}

.app-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    overflow-y: auto;
}

.start-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
}

.start-menu-item:hover {
    background: var(--hover-bg);
}

.start-menu-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
}

.start-menu-item span {
    font-size: 11px;
    text-align: center;
}

.user-profile {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#theme-selector {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
}

#theme-selector option {
    background: var(--window-bg);
    color: var(--text-color);
}

#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--login-bg);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#login-screen.hidden {
    display: none;
}

.login-box {
    background: var(--window-bg);
    padding: 40px;
    border-radius: 8px;
    width: 300px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: var(--input-bg);
    border: none;
    color: var(--text-color);
    border-radius: 4px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: var(--accent-color);
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

/* Window Styles */
.window {
    position: absolute;
    background: var(--window-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
    min-height: 200px;
    border: 1px solid var(--border-color);
    pointer-events: auto;
}

.window-header {
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: default;
}

.window-title {
    font-size: 12px;
    font-weight: 500;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close-btn {
    background: #ff5f56;
}

.minimize-btn {
    background: #ffbd2e;
}

.maximize-btn {
    background: #27c93f;
}

.window-content {
    flex: 1;
    position: relative;
    background: white;
}

.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    z-index: 10;
}

.resize-handle:hover {
    background: rgba(0, 120, 212, 0.3);
}

/* Corner handles */
.resize-nw {
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nw-resize;
}

.resize-ne {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: ne-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: sw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: se-resize;
}

/* Edge handles */
.resize-n {
    top: 0;
    left: 10px;
    right: 10px;
    height: 5px;
    cursor: n-resize;
}

.resize-s {
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 5px;
    cursor: s-resize;
}

.resize-e {
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 5px;
    cursor: e-resize;
}

.resize-w {
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 5px;
    cursor: w-resize;
}

/* Feedback System */
#feedback-btn {
    position: fixed;
    bottom: 35px;
    right: 20px;
    background: #e81123;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-weight: bold;
    transition: transform 0.2s;
}

#feedback-btn:hover {
    transform: scale(1.05);
}

#feedback-overlay {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd;
}

#feedback-overlay.hidden {
    display: none;
}

.feedback-header {
    background: #333;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-header h3 {
    margin: 0;
    font-size: 16px;
}

.feedback-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.feedback-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.feedback-input {
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
    display: flex;
    gap: 5px;
}

.feedback-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.feedback-input button {
    padding: 8px 15px;
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.feedback-thread {
    background: rgb(133, 133, 133);
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
}

.thread-msg {
    margin-bottom: 5px;
}

.thread-msg .meta {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.thread-comments {
    margin-top: 8px;
    padding-left: 10px;
    border-left: 2px solid #eee;
}

.comment {
    font-size: 13px;
    margin-bottom: 4px;
    color: #555;
}

.admin-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
    display: flex;
    gap: 5px;
}

.admin-actions button {
    font-size: 11px;
    padding: 3px 8px;
    background: #eee;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.admin-actions button:hover {
    background: #ddd;
}

.badge-bug {
    font-size: 11px;
    background: #e81123;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Guest Login Styles */
.guest-login-divider {
    margin: 20px 0 10px 0;
    text-align: center;
    position: relative;
    color: var(--text-secondary);
}

.guest-login-divider::before,
.guest-login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.guest-login-divider::before {
    left: 0;
}

.guest-login-divider::after {
    right: 0;
}

.login-box .guest-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.login-box .guest-btn:hover {
    background: rgba(var(--accent-color-rgb), 0.1);
}

.login-box .guest-info {
    margin-top: 15px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.guest-mode-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(255, 152, 0, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}