/* css/style.css */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
}

#desktop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 48px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 30%, #0f3460 60%, #533483 100%);
}

#desktop-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.desktop-icon {
    position: absolute;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 6px;
    cursor: grab;
    transition: background 0.15s;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon.selected {
    background: rgba(255, 255, 255, 0.18);
}

.desktop-icon.dragging {
    cursor: grabbing;
    opacity: 0.7;
}

.desktop-icon .icon-image {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 4px;
}

.desktop-icon .icon-label {
    color: #fff;
    font-size: 12px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    max-width: 76px;
}

/* Windows */
.window {
    position: absolute;
    min-width: 280px;
    min-height: 200px;
    background: #1e1e2e;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.window.focused {
    border-color: #5a5a7a;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.window.minimized {
    display: none;
}

.title-bar {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 8px;
    background: linear-gradient(180deg, #2a2a3e 0%, #222236 100%);
    border-bottom: 1px solid #3a3a4a;
    cursor: move;
    flex-shrink: 0;
}

.window.focused .title-bar {
    background: linear-gradient(180deg, #3a3a5e 0%, #2e2e4e 100%);
    border-bottom-color: #4a4a6a;
}

.title-text {
    flex: 1;
    color: #a0a0b8;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    pointer-events: none;
}

.window.focused .title-text {
    color: #e0e0f0;
}

.title-bar-buttons {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

.btn-minimize,
.btn-close {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.btn-minimize {
    background: #f5c842;
}

.btn-close {
    background: #e94560;
}

.btn-minimize:hover,
.btn-close:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.window-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Notepad */
.notepad-textarea {
    width: 100%;
    height: 100%;
    resize: none;
    border: none;
    outline: none;
    background: #16162a;
    color: #d4d4e8;
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px;
}

.notepad-textarea::placeholder {
    color: #4a4a6a;
}

/* Calculator */
.calculator-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px;
}

.calc-display {
    width: 100%;
    height: 52px;
    background: #0d0d1a;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    color: #e8e8f0;
    font-size: 22px;
    font-family: 'Consolas', monospace;
    text-align: right;
    padding: 0 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    white-space: nowrap;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    flex: 1;
}

.calc-btn {
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, transform 0.08s;
    color: #e0e0f0;
    background: #2a2a42;
}

.calc-btn:hover {
    background: #3a3a56;
}

.calc-btn:active {
    transform: scale(0.95);
    background: #4a4a66;
}

.calc-btn.operator {
    background: #3d2a5e;
    color: #c8a0ff;
}

.calc-btn.operator:hover {
    background: #4d3a6e;
}

.calc-btn.equals {
    background: #533483;
    color: #fff;
}

.calc-btn.equals:hover {
    background: #634493;
}

.calc-btn.clear {
    background: #4a2030;
    color: #ff8a9e;
}

.calc-btn.clear:hover {
    background: #5a3040;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(180deg, #2a2a3e 0%, #1e1e30 100%);
    border-top: 1px solid #3a3a4a;
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 999999;
}

#taskbar-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

.taskbar-btn {
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: #2e2e48;
    color: #b0b0c8;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    transition: background 0.12s, border-color 0.12s;
}

.taskbar-btn:hover {
    background: #3a3a56;
}

.taskbar-btn.active {
    background: #3e3e5e;
    border-color: #5a5a7a;
    color: #e8e8f0;
}

#clock {
    color: #a0a0b8;
    font-size: 12px;
    margin-left: 12px;
    white-space: nowrap;
}