/* Windows 95 Theme */
:root {
    --win-teal: #008080;
    --win-gray: #c0c0c0;
    --win-darkgray: #808080;
    --win-black: #000000;
    --win-white: #ffffff;
    --win-blue: #000080;
    --win-darkblue: #000080; /* The user requested a dark blue background */
    --win-font: Tahoma, Arial, sans-serif;
}

body {
    background-color: var(--win-darkblue);
    margin: 0;
    padding: 0;
    font-family: var(--win-font);
    font-size: 14px; /* Slightly smaller to match true 90s system fonts */
    color: var(--win-black);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--win-blue);
    text-decoration: underline;
}

a:hover {
    color: #ff0000;
}

/* Desktop Area */
.desktop-area {
    flex-grow: 1;
    position: relative;
    padding: 20px;
    overflow: hidden;
    display: flex;
    gap: 20px;
}

.icons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    width: 100px;
    flex-shrink: 0;
}

.windows-container {
    flex-grow: 1;
    position: relative;
    padding-right: 20px;
}

.desktop-icon {
    width: 80px;
    text-align: center;
}

.desktop-icon a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--win-white);
    text-decoration: none;
}

.desktop-icon .icon-img-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    margin: 0 auto 5px auto;
}

.desktop-icon .icon-img {
    width: 32px;
    height: 32px;
    background-color: var(--win-white);
    border: 2px solid var(--win-black);
    position: absolute;
    top: 0; left: 0;
}

.desktop-icon .icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    z-index: 2;
    line-height: 1;
}

img.icon-overlay {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(1px 1px 0 var(--win-black));
}

.desktop-icon .folder {
    background-color: #ffcc00;
    border: 2px solid var(--win-black);
}

.desktop-icon .folder::before {
    content: "";
    position: absolute;
    top: -6px;
    left: -2px;
    width: 12px;
    height: 6px;
    background-color: #ffcc00;
    border-top: 2px solid var(--win-black);
    border-left: 2px solid var(--win-black);
    border-right: 2px solid var(--win-black);
}

.desktop-icon .icon-label {
    color: var(--win-white);
    text-shadow: 1px 1px var(--win-black);
    font-size: 14px;
    word-break: break-word;
}

.desktop-icon a:hover .icon-label {
    background-color: var(--win-blue);
    color: var(--win-white);
    text-shadow: none;
}

.desktop-icon a:hover .icon-img {
    filter: invert(1);
}

/* Windows */
.window {
    background: var(--win-gray);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    padding: 2px;
    box-shadow: inset -1px -1px var(--win-darkgray), inset 1px 1px var(--win-white);
    margin: 0 auto;
    max-width: 800px;
}

.program-window {
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.title-bar {
    background: var(--win-blue);
    padding: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-text {
    color: var(--win-white);
    font-weight: bold;
    margin-left: 3px;
    letter-spacing: 1px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    background: var(--win-gray);
    border-top: 1px solid var(--win-white);
    border-left: 1px solid var(--win-white);
    border-right: 1px solid var(--win-black);
    border-bottom: 1px solid var(--win-black);
    box-shadow: inset -1px -1px var(--win-darkgray);
    font-size: 9px;
    font-weight: bold;
    line-height: 10px;
    cursor: pointer;
    margin-left: 2px;
}

.title-bar-controls button[aria-label="Close"]::after {
    content: "X";
}
.title-bar-controls button[aria-label="Maximize"]::after {
    content: "□";
}
.title-bar-controls button[aria-label="Minimize"]::after {
    content: "_";
}

.title-bar-controls button:active {
    border-top: 1px solid var(--win-black);
    border-left: 1px solid var(--win-black);
    border-right: 1px solid var(--win-white);
    border-bottom: 1px solid var(--win-white);
    box-shadow: inset 1px 1px var(--win-darkgray);
}

.taskbar-btn {
    display: flex;
    align-items: center;
    padding: 0 8px;
    height: 24px;
    background: var(--win-gray);
    border-top: 1px solid var(--win-white);
    border-left: 1px solid var(--win-white);
    border-right: 1px solid var(--win-black);
    border-bottom: 1px solid var(--win-black);
    font-weight: bold;
    font-size: 13px;
    color: var(--win-black);
    text-decoration: none;
    box-sizing: border-box;
    box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 var(--win-darkgray);
}

.taskbar-btn:active {
    border-top: 1px solid var(--win-black);
    border-left: 1px solid var(--win-black);
    border-right: 1px solid var(--win-white);
    border-bottom: 1px solid var(--win-white);
    box-shadow: inset 1px 1px 0 var(--win-darkgray), inset -1px -1px 0 #dfdfdf;
    padding: 1px 7px 0 9px;
}

.window-menu {
    padding: 2px 5px;
    border-bottom: 1px solid var(--win-darkgray);
}

.window-menu a {
    cursor: pointer;
    padding: 0 5px;
    display: inline-block;
    text-decoration: none;
    color: inherit;
}

.window-menu a::first-letter {
    text-decoration: underline;
}

.window-menu a:hover, .window-menu a.active {
    background: var(--win-blue);
    color: var(--win-white) !important;
}

.window-body {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
}
/* Notepad Content Area */
.post-content {
    max-width: 720px;
    margin: 0 auto;
}
/* Notepad Content Area */
.notepad-text {
    background: var(--win-white);
    border-top: 2px solid var(--win-darkgray);
    border-left: 2px solid var(--win-darkgray);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    padding: 15px;
    min-height: 300px;
}

.notepad-text img {
    max-width: 100%;
}

.recent-documents {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.recent-doc-item {
    display: flex;
    gap: 15px;
    align-items: center;
    border: 1px dotted var(--win-gray);
    padding: 10px;
}

.recent-doc-item:hover {
    background: #f0f0f0;
}

.recent-doc-image {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border: 1px solid var(--win-darkgray);
    overflow: hidden;
}

.recent-doc-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-wrapper img {
    max-width: 100%;
    border: 2px solid var(--win-darkgray);
    margin-bottom: 20px;
}

/* Sheep Animation */
.sheep {
    position: fixed;
    bottom: 30px;
    left: 0; /* Base position, JS handles translation */
    z-index: 999;
    font-size: 24px;
    margin-bottom: 0;
}

.sheep.do-hop {
    animation: single-hop 0.4s ease-in-out;
}

@keyframes single-hop {
    0% { margin-bottom: 0; }
    50% { margin-bottom: 25px; }
    100% { margin-bottom: 0; }
}

/* File Explorer */
.explorer-body {
    background: var(--win-white);
    border-top: 2px solid var(--win-darkgray);
    border-left: 2px solid var(--win-darkgray);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    padding: 0;
}

.file-list {
    display: flex;
    flex-direction: column;
}

.file-item {
    border-bottom: 1px dotted var(--win-gray);
}

.file-item a {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    color: var(--win-black);
    text-decoration: none;
}

.file-item a:hover {
    background: var(--win-darkgray);
    color: var(--win-white);
}

.file-thumbnail {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    margin-right: 15px;
    border: 2px solid var(--win-darkgray);
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-item .file-icon {
    width: 48px;
    height: 48px;
    background-color: var(--win-white);
    border: 2px solid var(--win-black);
    margin-right: 15px;
    position: relative;
    flex-shrink: 0;
}

.file-item .file-icon::before {
    content: "TXT";
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: var(--win-darkgray);
    line-height: 44px;
    text-align: left;
    padding-left: 4px;
}

.file-item .file-icon::after {
    content: "";
    position: absolute;
    top: 0px; right: -2px;
    border-top: 12px solid var(--win-black);
    border-left: 12px solid transparent;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: bold;
    font-size: 16px;
    margin: 0 0 5px 0;
}

.file-date {
    font-size: 12px;
    color: var(--win-darkgray);
    margin-bottom: 5px;
}

.file-excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.file-item a:hover .file-icon {
    filter: invert(1);
}

.file-item a:hover .file-date,
.file-item a:hover .file-excerpt {
    color: var(--win-white);
}

.pagination-footer {
    padding: 10px;
    background: var(--win-gray);
    border-top: 1px solid var(--win-darkgray);
}

/* Taskbar */
.taskbar {
    background: var(--win-gray);
    border-top: 2px solid var(--win-white);
    height: 30px;
    display: flex;
    align-items: center;
    padding: 2px;
    box-sizing: border-box;
    z-index: 1000;
}

.start-button a {
    display: flex;
    align-items: center;
    padding: 2px 5px;
    background: var(--win-gray);
    border-top: 2px solid var(--win-white);
    border-left: 2px solid var(--win-white);
    border-right: 2px solid var(--win-black);
    border-bottom: 2px solid var(--win-black);
    font-weight: bold;
    color: var(--win-black);
    height: 22px;
    box-sizing: border-box;
    text-decoration: none;
}

.start-button a:active {
    border-top: 2px solid var(--win-black);
    border-left: 2px solid var(--win-black);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    padding: 3px 4px 1px 6px;
}

.start-icon {
    margin-right: 5px;
}

.taskbar-divider {
    width: 2px;
    height: 20px;
    background: var(--win-darkgray);
    border-right: 1px solid var(--win-white);
    margin: 0 10px;
}

.taskbar-tasks {
    flex-grow: 1;
}

.taskbar-tray {
    border-top: 2px solid var(--win-darkgray);
    border-left: 2px solid var(--win-darkgray);
    border-right: 2px solid var(--win-white);
    border-bottom: 2px solid var(--win-white);
    padding: 2px 10px;
    display: flex;
    align-items: center;
    height: 22px;
    box-sizing: border-box;
}

/* Ghost Default Classes */
.kg-width-wide {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

.kg-width-full {
    width: 100vw;
    position: relative;
    left: calc(50% - 50vw);
}

/* Newsletter Popup Tooltip */
.newsletter-popup {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: #ffffe1;
    border: 1px solid #000;
    padding: 10px;
    width: 200px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    color: #000;
    z-index: 1001;
    font-size: 12px;
}

.newsletter-popup::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 20px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #000 transparent transparent;
    display: block;
    width: 0;
}

.newsletter-popup::before {
    content: "";
    position: absolute;
    bottom: -4px;
    right: 21px;
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: #ffffe1 transparent transparent;
    display: block;
    width: 0;
    z-index: 1;
}

.popup-close {
    float: right;
    cursor: pointer;
    font-weight: bold;
    border: 1px solid #000;
    padding: 0 3px;
    background: var(--win-gray);
    font-size: 10px;
    line-height: 12px;
}

.popup-close:active {
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
}

.popup-btn {
    display: inline-block;
    margin-top: 5px;
    background: var(--win-gray);
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 2px 5px;
    color: #000;
    text-decoration: none;
    font-weight: bold;
}

.popup-btn:active {
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .desktop-area {
        flex-direction: column;
        padding: 10px;
        overflow: hidden;
    }
    .icons-container {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 10px;
        gap: 10px;
    }
    .desktop-icon {
        flex-shrink: 0;
    }
    .windows-container {
        padding-right: 0;
        overflow-y: auto;
    }
}
