/* Windows 98 Color Palette */
:root {
    --surface: #c0c0c0;
    --button-highlight: #ffffff;
    --button-face: #dfdfdf;
    --button-shadow: #808080;
    --window-frame: #0831d9;
    --dialog-blue: #000080;
    --dialog-blue-light: #1084d0;
    --button-text: #222222;
    --text-color: #000000;
    --terminal-green: #33ff33;
    --terminal-amber: #ffb000;
    --link-blue: #0000ff;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MS Sans Serif', 'Microsoft Sans Serif', sans-serif;
    font-size: 11px;
    overflow: hidden;
    background: #000; /* Black for terminal */
    color: var(--text-color);
}

/* Login Screen */
.login-screen {
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #000;
    border: 2px solid var(--terminal-green);
    padding: 30px;
    min-width: 600px;
    box-shadow: 0 0 20px rgba(51, 255, 51, 0.3);
}

.login-logo {
    margin-bottom: 20px;
}

.login-ascii {
    color: var(--terminal-green);
    font-size: 8px;
    line-height: 1.2;
    text-align: center;
    margin: 0;
    font-family: monospace;
}

.login-title {
    color: var(--terminal-green);
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.login-subtitle {
    color: var(--terminal-green);
    text-align: center;
    font-size: 12px;
    margin-bottom: 30px;
    font-family: 'Courier New', monospace;
    opacity: 0.8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form label {
    color: var(--terminal-green);
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.login-input {
    background: #000;
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 8px;
    outline: none;
}

.login-input:focus {
    box-shadow: 0 0 10px rgba(51, 255, 51, 0.5);
}

.login-button {
    background: #000;
    border: 2px solid var(--terminal-green);
    color: var(--terminal-green);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 10px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.login-button:hover {
    background: var(--terminal-green);
    color: #000;
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.7);
}

.login-button:active {
    transform: scale(0.98);
}

.login-hint {
    color: var(--terminal-green);
    text-align: center;
    font-size: 11px;
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    opacity: 0.6;
}

/* Boot Terminal */
.boot-terminal {
    width: 100vw;
    height: 100vh;
    background: #000;
    color: var(--terminal-green);
    font-family: 'Courier New', monospace;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.terminal-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.boot-text {
    color: var(--terminal-green);
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    margin: 0;
    font-family: 'Courier New', monospace;
}

.command-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}

.prompt-text {
    color: var(--terminal-green);
    margin-right: 5px;
    font-weight: bold;
}

.command-input {
    background: transparent;
    border: none;
    color: var(--terminal-green);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    flex: 1;
    caret-color: transparent;
}

.terminal-cursor-static {
    color: var(--terminal-green);
    animation: blink-cursor 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Desktop Background */
.desktop {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #008080 0%, #004d4d 100%);
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: var(--surface);
    border-top: 1px solid var(--button-highlight);
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 1000;
    box-shadow: inset 1px 1px 0 var(--button-highlight), inset -1px -1px 0 var(--button-shadow);
}

.start-button {
    height: 24px;
    padding: 0 20px 0 4px;
    background: var(--surface);
    border: 2px outset var(--button-highlight);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: bold;
}

.start-button:active {
    border-style: inset;
}

.start-button::before {
    content: '⊞';
    font-size: 16px;
    font-weight: bold;
}

.taskbar-audio-controls {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.taskbar-button {
    height: 22px;
    padding: 0 8px;
    background: var(--surface);
    border: 2px outset var(--button-highlight);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
}

.taskbar-button:hover {
    background: var(--button-face);
}

.taskbar-button:active {
    border-style: inset;
}

.taskbar-button.muted {
    border-style: inset;
    background: #a0a0a0;
}

.taskbar-clock {
    margin-left: auto;
    padding: 2px 8px;
    border: 1px inset var(--button-shadow);
    background: var(--surface);
    font-size: 11px;
}

/* Window */
.window {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: calc(100vh - 28px); /* Account for taskbar */
    background: var(--surface);
    border: none;
    display: flex;
    flex-direction: column;
}

/* Title Bar */
.title-bar {
    background: linear-gradient(180deg, #1084d0 0%, #0831d9 100%);
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;
}

.title-bar-text {
    color: white;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.title-icon {
    width: 16px;
    height: 16px;
}

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

.title-bar-button {
    width: 16px;
    height: 14px;
    background: var(--surface);
    border: 1px outset var(--button-highlight);
    cursor: pointer;
    font-size: 8px;
    position: relative;
}

.title-bar-button:active {
    border-style: inset;
}

.title-bar-button.minimize::after {
    content: '_';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
}

.title-bar-button.maximize::after {
    content: '□';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
}

.title-bar-button.close::after {
    content: '×';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
}

/* Menu Bar */
.menu-bar {
    background: var(--surface);
    display: flex;
    padding: 2px 4px;
    border-bottom: 1px solid var(--button-shadow);
}

.menu-item {
    padding: 4px 8px;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--dialog-blue);
    color: white;
}

/* Toolbar */
.toolbar {
    background: var(--surface);
    padding: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
    border-bottom: 1px solid var(--button-shadow);
    flex-wrap: wrap;
}

.toolbar-button {
    padding: 4px 8px;
    background: var(--surface);
    border: 2px outset var(--button-highlight);
    cursor: pointer;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

.toolbar-button:active {
    border-style: inset;
}

.mode-toggle {
    margin-left: auto;
    font-weight: bold;
}

.address-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 200px;
}

.address-bar input {
    flex: 1;
    padding: 2px 4px;
    border: 1px inset var(--button-shadow);
    background: white;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

/* Status Info with Marquee */
.status-info {
    background: #000;
    color: var(--terminal-green);
    padding: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    border-bottom: 1px solid var(--button-shadow);
}

marquee {
    color: var(--terminal-green);
}

/* Window Body */
.window-body {
    flex: 1;
    background: white;
    padding: 16px;
    overflow-y: auto;
    border: 2px inset var(--button-shadow);
    margin: 2px;
}

/* Construction Banner */
.construction-banner {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: yellow;
    border: 3px dashed #ff0000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.construction-banner img {
    height: 30px;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blinker 1s step-start infinite;
    font-weight: bold;
    color: #ff0000;
}

/* File Grid (Windows Explorer Style) */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px;
    padding: 10px;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border: 1px solid transparent;
}

.file-item:hover {
    background: rgba(0, 0, 139, 0.1);
    border: 1px dotted var(--dialog-blue);
}

.file-item.selected {
    background: var(--dialog-blue);
    color: white;
}

.icon {
    font-size: 32px;
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.file-label {
    font-size: 11px;
    text-align: center;
    word-wrap: break-word;
    max-width: 80px;
}

/* Terminal Mode */
.terminal-mode {
    background: #000;
    color: var(--terminal-green);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 12px;
}

.terminal-header {
    color: var(--terminal-amber);
    margin-bottom: 10px;
    font-size: 10px;
}

.terminal-output {
    line-height: 1.4;
}

.terminal-output div {
    margin: 2px 0;
}

.prompt {
    color: var(--terminal-green);
    font-weight: bold;
}

.cursor {
    animation: blink-cursor 1s step-end infinite;
    background: var(--terminal-green);
    color: #000;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Status Bar */
.status-bar {
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--button-shadow);
    padding: 2px 4px;
    font-size: 11px;
    gap: 10px;
}

.status-item {
    padding: 2px 8px;
    border-left: 1px solid var(--button-shadow);
}

.status-item:first-child {
    border-left: none;
}

.status-online {
    color: green;
    font-weight: bold;
}

/* ASCII Decoration */
.ascii-decoration {
    position: fixed;
    bottom: 40px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--terminal-green);
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    border: 2px solid var(--terminal-green);
    box-shadow: 0 0 10px rgba(51, 255, 51, 0.5);
    z-index: 999;
}

/* Visitor Counter */
.visitor-counter {
    position: fixed;
    bottom: 280px;
    right: 20px;
    background: var(--surface);
    padding: 8px 12px;
    border: 2px outset var(--button-highlight);
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 999;
}

.visitor-counter img {
    height: 20px;
}

.counter-digits {
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 2px;
}

/* Ad Banner Container */
.ad-banner-container {
    position: fixed;
    bottom: 40px;
    right: 20px;
    background: var(--surface);
    border: 2px outset var(--button-highlight);
    padding: 8px;
    z-index: 1001;
    width: 234px;
}

.ad-banner-title {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: bold;
    color: var(--dialog-blue);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--button-shadow);
    padding-bottom: 4px;
}

.ad-banner {
    width: 218px;
    height: 90px;
    background: white;
    border: 1px inset var(--button-shadow);
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-banner:last-child {
    margin-bottom: 0;
}

.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.loading-ad {
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 10px;
    color: #666;
    text-align: center;
    animation: blink-cursor 1s step-end infinite;
}

.ad-error {
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 9px;
    color: #999;
    text-align: center;
    padding: 4px;
}

/* Scrollbar Styling (Windows 98 style) */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--button-face);
    border: 2px outset var(--button-highlight);
}

::-webkit-scrollbar-corner {
    background: var(--surface);
}

::-webkit-scrollbar-button {
    background: var(--surface);
    border: 2px outset var(--button-highlight);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .window {
        width: 95%;
        height: 90%;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }

    .ascii-decoration,
    .visitor-counter {
        display: none;
    }
}
