/* Retro Hybrid OS Styles - "Inspired By" */

/* Fonts */
body {
    background-color: #008080;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: "Geneva", "Verdana", sans-serif;
    font-size: 12px;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

.desktop {
    width: 100vw;
    height: calc(100vh - 28px);
    position: absolute;
    top: 28px;
    left: 0;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 30px;
}

/* TOP BAR (Mac Inspired) */
.start-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: #f0f0f0;
    border-bottom: 2px solid #808080;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 100000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    justify-content: space-between;
}

.start-button {
    font-weight: bold;
    font-size: 16px;
    padding: 2px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.start-button:hover {
    background: #ddd;
    border-radius: 4px;
}

.start-menu {
    position: absolute;
    top: 28px;
    left: 5px;
    width: 220px;
    background: #f0f0f0;
    border: 1px solid #808080;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 100001;
    border-radius: 0 0 4px 4px;
}

.start-menu.open {
    display: block;
}

.start-menu-item {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
}

.start-menu-item:last-child {
    border-bottom: none;
}

.start-menu-item:hover {
    background-color: #000080;
    color: white;
}

.task-bar-items {
    display: flex;
    gap: 5px;
    flex-grow: 1;
    margin-left: 20px;
}

.task-button {
    background: transparent;
    border: 1px solid transparent;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    color: #333;
}

.task-button:hover {
    background: #e0e0e0;
    border: 1px solid #ccc;
}

.task-button.active {
    background: #ddd;
    font-weight: bold;
    border: 1px solid #bbb;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.clock {
    font-weight: bold;
    margin-left: 10px;
}

/* WINDOWS - Generic Retro */
.window {
    position: absolute;
    min-width: 300px;
    background: #d4d0c8;
    border: 2px solid;
    border-color: #f0f0f0 #404040 #404040 #f0f0f0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: bold;
    user-select: none;
}

.title-bar-text {
    flex-grow: 1;
}

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

.title-bar-controls button {
    width: 16px;
    height: 14px;
    background: #d4d0c8;
    border: 1px solid;
    border-color: #f0f0f0 #404040 #404040 #f0f0f0;
    font-size: 10px;
    line-height: 10px;
    padding: 0;
    font-weight: bold;
    cursor: pointer;
}

.title-bar-controls button:active {
    border-color: #404040 #f0f0f0 #f0f0f0 #404040;
}

.window-body {
    padding: 10px;
    flex-grow: 1;
    overflow: auto;
    font-family: inherit;
}

/* ICONS (Emojis) */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px black;
    margin-bottom: 20px;
}

.desktop-icon .icon-emoji {
    font-size: 32px;
    margin-bottom: 5px;
    filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.5));
}

.desktop-icon .icon-img {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    display: none;
}

.desktop-icon.has-image .icon-emoji {
    display: none;
}

.desktop-icon.has-image .icon-img {
    display: block;
}

.desktop-icon span {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
}

.desktop-icon:hover span {
    background: #000080;
}

/* APP: Notepad */
.notepad-body {
    background: white;
    font-family: "Courier New", monospace;
    padding: 2px;
    overflow-y: scroll;
    height: 100%;
}

.notepad-content {
    padding: 10px;
    font-size: 13px;
    line-height: 1.5;
}

/* APP: Documents */
.docs-window-body {
    background: white;
    border: 1px solid #808080;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0;
    height: 100%;
    overflow: auto;
    padding: 10px;
}

.docs-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.doc-file {
    background: transparent;
    border: 1px solid transparent;
    color: #000000;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    text-align: center;
}

.doc-file:hover,
.doc-file:focus {
    background: #000080;
    color: #ffffff;
}

.doc-file-icon {
    font-size: 28px;
}

.doc-file-name {
    font-size: 11px;
    word-break: break-word;
}

.docs-hint {
    color: #404040;
    font-size: 11px;
    margin-top: 10px;
}

.doc-viewer-body {
    background: #ffffff;
    font-family: "Times New Roman", serif;
}

.doc-viewer-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 12px 16px;
}

.doc-viewer-title {
    margin: 0 0 10px;
    font-size: 20px;
}

.doc-viewer-text ul,
.doc-viewer-text ol {
    padding-left: 18px;
}

.doc-viewer-image {
    margin-top: 12px;
    border: 1px solid #000000;
    padding: 4px;
}

.doc-viewer-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* APP: Paint */
.paint-body {
    background: #c0c0c0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.paint-toolbar {
    display: flex;
    gap: 2px;
    padding: 5px;
    border-bottom: 1px solid gray;
}

.paint-canvas-area {
    margin: 10px;
    background: white;
    box-shadow: inset 2px 2px 5px gray;
    flex-grow: 1;
    position: relative;
    padding: 20px;
    overflow: auto;
}

.paint-card {
    border: 2px solid black;
    padding: 10px;
    margin-bottom: 20px;
    width: 200px;
    display: inline-block;
    vertical-align: top;
    margin-right: 20px;
    background: white;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

/* APP: Excel */
.excel-body {
    background: #c0c0c0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.excel-grid {
    background: white;
    flex-grow: 1;
    overflow: auto;
    border: 1px solid #808080;
    margin: 5px;
}

.excel-tabs {
    display: flex;
    padding-left: 5px;
    margin-bottom: 2px;
}

.excel-tab {
    padding: 2px 10px;
    margin-right: -1px;
    border: 1px solid #808080;
    border-bottom: none;
    background: #e0e0e0;
    cursor: pointer;
    border-radius: 3px 3px 0 0;
    font-size: 11px;
}

.excel-tab.active {
    background: white;
    font-weight: bold;
    border-bottom: 1px solid white;
    position: relative;
    top: 1px;
}

/* APP: Sticky Note (Reverted to Grey) */
.sticky-body {
    background: #d4d0c8 !important;
    /* Standard Retro Grey */
    color: black;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    padding: 15px;
    height: 100%;
}

/* APP: Terminal */
.terminal-body {
    background: #0b0d10;
    color: #cfead3;
    font-family: "Consolas", "Menlo", "Courier New", monospace;
    padding: 12px;
    height: 100%;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.35;
    position: relative;
}

.terminal-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 3px;
    pointer-events: none;
    opacity: 0.35;
}

.terminal-body > * {
    position: relative;
    z-index: 1;
}

.terminal-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #0f1a14;
    border: 1px solid #1c3c2a;
    box-shadow: inset 0 0 0 1px #0a0f0b;
    padding: 6px 8px;
    margin-bottom: 10px;
}

.terminal-header-title {
    color: #7cff9b;
    font-weight: bold;
    letter-spacing: 0.4px;
}

.terminal-header-subtitle {
    color: #9db8a3;
    font-size: 12px;
}

.terminal-ascii {
    color: #67ff88;
    margin: 0 0 10px;
}

.terminal-meta {
    color: #cfead3;
    margin: 0 0 4px;
}

.terminal-prompt {
    color: #cfead3;
    margin: 0;
}

.terminal-user {
    color: #7cff9b;
    font-weight: bold;
}

.terminal-path {
    color: #7ad1ff;
}

.terminal-cursor {
    color: #7cff9b;
}

.chart-container {
    background: white;
    border: 2px inset #dfdfdf;
    padding: 10px;
}

canvas {
    image-rendering: pixelated;
}
