/* === Pandan OS 98 - Windows 98 Style === */
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans&display=swap');

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

body {
    font-family: 'Tahoma', 'MS Sans Serif', 'Arial', sans-serif;
    font-size: 11px;
    overflow: hidden;
    user-select: none;
    background: #008080;
}

/* === Boot Screen === */
#boot-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.boot-logo { text-align: center; }
.boot-flag { font-size: 48px; letter-spacing: 4px; margin-bottom: 8px; }
.boot-text { color: #fff; font-size: 36px; font-weight: bold; }
.boot-98 { color: #c0c0c0; font-style: italic; }
.boot-subtitle { color: #aaa; margin-top: 8px; font-size: 14px; }
.boot-progress {
    margin-top: 20px; width: 300px; height: 18px;
    background: #000; border: 2px inset #808080;
}
.boot-progress-bar {
    height: 100%; width: 0; background: #000080;
    animation: bootLoad 2.2s linear forwards;
}
@keyframes bootLoad { to { width: 100%; } }

/* === Desktop === */
#desktop { 
    display: none; width: 100vw; height: 100vh; position: relative; 
    background: #008080;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 220'%3E%3C!-- body --%3E%3Cellipse cx='100' cy='155' rx='55' ry='60' fill='%23fff'/%3E%3C!-- head --%3E%3Ccircle cx='100' cy='80' r='50' fill='%23fff'/%3E%3C!-- ears --%3E%3Ccircle cx='60' cy='40' r='18' fill='%23222'/%3E%3Ccircle cx='140' cy='40' r='18' fill='%23222'/%3E%3C!-- eye patches --%3E%3Cellipse cx='78' cy='78' rx='18' ry='16' fill='%23222' transform='rotate(-10 78 78)'/%3E%3Cellipse cx='122' cy='78' rx='18' ry='16' fill='%23222' transform='rotate(10 122 78)'/%3E%3C!-- eyes --%3E%3Ccircle cx='80' cy='76' r='6' fill='%23fff'/%3E%3Ccircle cx='120' cy='76' r='6' fill='%23fff'/%3E%3Ccircle cx='82' cy='74' r='3' fill='%23111'/%3E%3Ccircle cx='122' cy='74' r='3' fill='%23111'/%3E%3C!-- eye shine --%3E%3Ccircle cx='84' cy='72' r='1.5' fill='%23fff'/%3E%3Ccircle cx='124' cy='72' r='1.5' fill='%23fff'/%3E%3C!-- nose --%3E%3Cellipse cx='100' cy='92' rx='6' ry='4' fill='%23222'/%3E%3C!-- mouth --%3E%3Cpath d='M92 96 Q100 106 108 96' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round'/%3E%3C!-- arms --%3E%3Cellipse cx='52' cy='145' rx='18' ry='28' fill='%23222' transform='rotate(15 52 145)'/%3E%3Cellipse cx='148' cy='145' rx='18' ry='28' fill='%23222' transform='rotate(-15 148 145)'/%3E%3C!-- legs --%3E%3Cellipse cx='75' cy='200' rx='20' ry='16' fill='%23222'/%3E%3Cellipse cx='125' cy='200' rx='20' ry='16' fill='%23222'/%3E%3C!-- belly patch --%3E%3Cellipse cx='100' cy='155' rx='30' ry='32' fill='%23f0f0f0'/%3E%3C!-- blush --%3E%3Ccircle cx='68' cy='92' r='8' fill='%23ffcccc' opacity='0.5'/%3E%3Ccircle cx='132' cy='92' r='8' fill='%23ffcccc' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 280px auto;
}

/* === Desktop Icons === */
#desktop-icons {
    position: absolute; top: 8px; left: 8px;
    display: flex; flex-direction: column; gap: 8px;
}
.desktop-icon {
    width: 70px; text-align: center; padding: 4px; cursor: pointer; border: 1px solid transparent;
}
.desktop-icon:hover { background: rgba(0,0,128,0.3); }
.desktop-icon.selected { background: #000080; color: #fff; }
.desktop-icon .icon-img { font-size: 32px; display: block; margin-bottom: 2px; }
.desktop-icon .icon-label {
    color: #fff; font-size: 11px; text-shadow: 1px 1px #000;
    word-wrap: break-word;
}
.desktop-icon.selected .icon-label { text-shadow: none; }

/* === Win98 Window === */
.win98-window {
    position: absolute; background: #c0c0c0;
    border: 2px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0 #000;
    display: flex; flex-direction: column;
    min-width: 200px; min-height: 120px;
}
.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff; font-weight: bold; font-size: 11px;
    padding: 2px 4px; display: flex; align-items: center; justify-content: space-between;
    cursor: default; flex-shrink: 0;
}
.title-bar.inactive {
    background: linear-gradient(90deg, #808080, #b0b0b0);
}
.title-bar-text { flex: 1; padding-left: 2px; white-space: nowrap; overflow: hidden; }
.title-bar-controls { display: flex; gap: 2px; }
.title-bar-controls button {
    width: 16px; height: 14px; font-size: 9px; line-height: 1;
    background: #c0c0c0; border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; font-family: 'Tahoma', sans-serif; font-weight: bold;
}
.title-bar-controls button:active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}
.window-body {
    flex: 1; overflow: auto; background: #c0c0c0;
}

/* === Menu Bar === */
.menu-bar {
    background: #c0c0c0; padding: 1px 0; display: flex; border-bottom: 1px solid #808080;
    flex-shrink: 0;
}
.menu-bar-item {
    padding: 2px 8px; cursor: pointer; position: relative;
}
.menu-bar-item:hover { background: #000080; color: #fff; }
.menu-dropdown {
    display: none; position: absolute; top: 100%; left: 0;
    background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf;
    min-width: 150px; z-index: 1000; box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.menu-bar-item:hover .menu-dropdown { display: block; }

/* === Win98 Shared Menu Styles === */
.win98-menu {
    background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3); z-index: 10000;
}
.menu-item {
    padding: 4px 24px 4px 8px; cursor: pointer; white-space: nowrap; position: relative;
}
.menu-item:hover { background: #000080; color: #fff; }
.menu-separator { height: 1px; background: #808080; margin: 2px 4px; border-bottom: 1px solid #dfdfdf; }
.menu-icon { display: inline-block; width: 20px; text-align: center; }
.submenu-arrow { float: right; }
.has-submenu { position: relative; }
.submenu {
    display: none; position: absolute; left: 100%; top: -2px;
}
.has-submenu:hover > .submenu { display: block; }

/* === Taskbar === */
#taskbar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 28px;
    background: #c0c0c0;
    border-top: 2px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf;
    display: flex; align-items: center; padding: 2px; z-index: 9999;
}
#start-button {
    height: 22px; padding: 0 6px; font-weight: bold; font-size: 11px;
    background: #c0c0c0; border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    cursor: pointer; display: flex; align-items: center; gap: 4px;
    font-family: 'Tahoma', sans-serif; flex-shrink: 0;
}
#start-button:active, #start-button.active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}
#start-button img { width: 16px; height: 16px; }
#taskbar-buttons {
    flex: 1; display: flex; gap: 2px; margin-left: 4px; overflow: hidden;
}
.taskbar-btn {
    height: 22px; padding: 0 8px; font-size: 11px;
    background: #c0c0c0; border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    cursor: pointer; font-family: 'Tahoma', sans-serif;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 160px; text-align: left; display: flex; align-items: center; gap: 4px;
}
.taskbar-btn.active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #b0b0b0;
}
#system-tray {
    border: 1px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 2px 8px; margin-left: auto; font-size: 11px; flex-shrink: 0;
}

/* === Start Menu === */
#start-menu {
    position: fixed; bottom: 28px; left: 0;
    background: #c0c0c0; border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    display: flex; z-index: 10001; min-width: 200px;
    box-shadow: 2px -2px 4px rgba(0,0,0,0.2);
}
.start-menu-sidebar {
    background: linear-gradient(to top, #000080, #1084d0);
    width: 24px; display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 8px;
}
.sidebar-text {
    color: #c0c0c0; font-size: 14px; writing-mode: vertical-rl;
    transform: rotate(180deg); letter-spacing: 1px;
}
.start-menu-items { flex: 1; padding: 2px 0; }

/* === Win98 Button === */
.win98-btn {
    background: #c0c0c0; border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 3px 16px; font-family: 'Tahoma', sans-serif; font-size: 11px;
    cursor: pointer;
}
.win98-btn:active { border-color: #808080 #dfdfdf #dfdfdf #808080; }
.win98-btn:focus { outline: 1px dotted #000; outline-offset: -4px; }

/* === Win98 Input === */
.win98-input, .win98-textarea, .win98-select {
    background: #fff; border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    font-family: 'Tahoma', sans-serif; font-size: 11px; padding: 2px 4px;
}
.win98-textarea { resize: none; }

/* === Inset Panel === */
.inset {
    border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #fff;
}

/* === Status Bar === */
.status-bar {
    background: #c0c0c0; border-top: 1px solid #808080;
    padding: 2px 4px; font-size: 11px; display: flex; flex-shrink: 0;
}
.status-bar-field {
    border: 1px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 1px 4px; flex: 1;
}

/* === Context Menu === */
#context-menu { position: fixed; }

/* === Resize Handle === */
.resize-handle {
    position: absolute; bottom: 0; right: 0; width: 16px; height: 16px;
    cursor: se-resize;
}

/* === Shutdown === */
#shutdown-dialog {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000080; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
}
.shutdown-box { width: 400px; }

/* === Calculator === */
.calc-display {
    background: #ecece4; border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    text-align: right; padding: 4px 8px; font-size: 20px;
    font-family: 'Courier New', monospace; margin: 4px;
    overflow: hidden; white-space: nowrap;
}
.calc-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 4px; }
.calc-btn {
    background: #c0c0c0; border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 6px; font-size: 12px; cursor: pointer; font-family: 'Tahoma', sans-serif;
    text-align: center;
}
.calc-btn:active { border-color: #808080 #dfdfdf #dfdfdf #808080; }
.calc-btn.op { color: #800000; }
.calc-btn.eq { background: #d0d0d0; }

/* === Minesweeper === */
.mine-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 8px; background: #c0c0c0;
    border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
    margin: 4px;
}
.mine-counter, .mine-timer {
    background: #000; color: #f00; font-family: 'Courier New', monospace;
    font-size: 20px; font-weight: bold; padding: 2px 4px; min-width: 45px;
    text-align: center; border: 1px inset #808080;
}
.mine-face {
    font-size: 20px; cursor: pointer; background: #c0c0c0;
    border: 2px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.mine-face:active { border-color: #808080 #dfdfdf #dfdfdf #808080; }
.mine-grid {
    display: inline-grid; margin: 4px; border: 3px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}
.mine-cell {
    width: 20px; height: 20px; font-size: 12px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    background: #c0c0c0;
}
.mine-cell.revealed {
    border: 1px solid #808080; background: #c0c0c0;
}
.mine-cell.mine-exploded { background: #ff0000; }
.mine-cell .n1 { color: #0000ff; } .mine-cell .n2 { color: #008000; }
.mine-cell .n3 { color: #ff0000; } .mine-cell .n4 { color: #000080; }
.mine-cell .n5 { color: #800000; } .mine-cell .n6 { color: #008080; }
.mine-cell .n7 { color: #000; } .mine-cell .n8 { color: #808080; }

/* === Paint === */
.paint-toolbar {
    display: flex; gap: 2px; padding: 2px; background: #c0c0c0;
    border-bottom: 1px solid #808080; flex-wrap: wrap; flex-shrink: 0;
}
.paint-tool {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border: 1px solid transparent; cursor: pointer; font-size: 14px;
}
.paint-tool:hover { border: 1px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf; }
.paint-tool.active { border: 1px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; background: #b0b0b0; }
.paint-colors {
    display: flex; gap: 1px; padding: 4px; background: #c0c0c0;
    border-top: 1px solid #808080; flex-shrink: 0;
}
.paint-color {
    width: 16px; height: 16px; border: 1px solid #808080; cursor: pointer;
}
.paint-color.active { border: 2px solid #000; }
.paint-canvas-area {
    flex: 1; overflow: auto; background: #808080; padding: 4px;
}

/* === Notepad === */
.notepad-textarea {
    width: 100%; height: 100%; border: none; resize: none;
    font-family: 'Courier New', monospace; font-size: 12px;
    padding: 4px; outline: none;
}

/* === Explorer === */
.explorer-sidebar {
    width: 180px; background: #fff; border-right: 1px solid #808080;
    overflow-y: auto; flex-shrink: 0;
}
.explorer-main { flex: 1; background: #fff; overflow-y: auto; padding: 8px; }
.explorer-item {
    padding: 2px 4px 2px 20px; cursor: pointer; white-space: nowrap;
}
.explorer-item:hover { background: #000080; color: #fff; }
.explorer-file { display: inline-flex; align-items: center; gap: 4px; padding: 4px; cursor: pointer; }
.explorer-file:hover { background: #000080; color: #fff; }

/* === Internet Explorer === */
.ie-toolbar {
    background: #c0c0c0; padding: 2px 4px; display: flex; gap: 4px;
    align-items: center; border-bottom: 1px solid #808080; flex-shrink: 0;
}
.ie-address {
    flex: 1; background: #fff; border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 2px 4px; font-size: 11px; font-family: 'Tahoma', sans-serif;
}
.ie-content { flex: 1; background: #fff; overflow: auto; }

/* === Command Prompt === */
.cmd-body {
    background: #000; color: #c0c0c0; font-family: 'Courier New', monospace;
    font-size: 13px; padding: 4px; height: 100%; overflow-y: auto;
}
.cmd-input {
    background: transparent; color: #c0c0c0; border: none; outline: none;
    font-family: 'Courier New', monospace; font-size: 13px; width: calc(100% - 40px);
    caret-color: #c0c0c0;
}

/* === Solitaire === */
.solitaire-area {
    background: #008000; width: 100%; height: 100%;
    padding: 8px; position: relative; overflow: hidden;
}
.card-stack { position: absolute; }
.card {
    width: 60px; height: 84px; background: #fff; border: 1px solid #000;
    border-radius: 3px; font-size: 11px; position: absolute; cursor: pointer;
    display: flex; flex-direction: column; padding: 2px;
}
.card.face-down {
    background: linear-gradient(135deg, #000080 25%, #0000c0 25%, #0000c0 50%, #000080 50%, #000080 75%, #0000c0 75%);
    background-size: 8px 8px;
    border: 2px solid #fff;
}
.card.red { color: #cc0000; }
.card.black { color: #000; }
.card-placeholder {
    width: 60px; height: 84px; border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 3px; position: absolute;
}
.card-top { font-size: 12px; font-weight: bold; }
.card-suit { font-size: 20px; text-align: center; flex: 1; display: flex; align-items: center; justify-content: center; }
