/* Windows 98 Terminal - Custom Styling */

/* Desktop Environment */
.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(45deg, #008080 25%, #004040 25%, #004040 50%, #008080 50%, #008080 75%, #004040 75%, #004040);
    background-size: 20px 20px;
    overflow: hidden;
    font-family: 'MS Sans Serif', sans-serif;
}

/* Desktop Icons */
.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 8px;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.2s;
}

.desktop-icon:hover {
    background-color: rgba(0, 128, 128, 0.3);
}

.desktop-icon.selected {
    background-color: #000080;
    color: white;
}

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

.icon-label {
    font-size: 11px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
}

/* Window Enhancements */
.window {
    position: absolute;
    min-width: 200px;
    min-height: 100px;
    border: 2px outset #c0c0c0;
    background: #c0c0c0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.window.active {
    z-index: 200;
}

.window.minimized {
    display: none;
}

.window.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 40px) !important;
    z-index: 150;
}

/* Title Bar Styling */
.title-bar {
    background: linear-gradient(90deg, #000080, #0040c0);
    color: white;
    padding: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
}

.title-bar-text {
    font-size: 11px;
    font-weight: bold;
    padding-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.title-bar-controls button {
    width: 16px;
    height: 14px;
    font-size: 9px;
    padding: 0;
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    cursor: pointer;
}

.title-bar-controls button:active {
    border: 1px inset #c0c0c0;
}

/* Window Body */
.window-body {
    padding: 8px;
    height: calc(100% - 26px);
    overflow: auto;
    background: #c0c0c0;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 8px;
    border-bottom: 1px solid #808080;
}

.tab {
    padding: 4px 12px;
    border: 1px outset #c0c0c0;
    border-bottom: none;
    background: #c0c0c0;
    cursor: pointer;
    font-size: 11px;
}

.tab.active {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.tab-content {
    display: none;
    background: white;
    padding: 8px;
    border: 1px inset #c0c0c0;
    min-height: 300px;
}

.tab-content.active {
    display: block;
}

/* Terminal Styling */
.terminal-content {
    background: black;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 8px;
    height: 100%;
    border: 1px inset #c0c0c0;
}

.terminal-output {
    white-space: pre-wrap;
    line-height: 1.2;
}

.terminal-cursor {
    background: #00ff00;
    color: black;
    animation: blink 1s infinite;
}

.terminal-success {
    color: #00ff00;
}

.terminal-info {
    color: #00ffff;
}

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

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #c0c0c0;
    border-top: 1px solid #dfdfdf;
    display: flex;
    align-items: center;
    z-index: 1000;
    font-size: 11px;
}

.start-button {
    height: 30px;
    padding: 2px 8px;
    margin: 2px;
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.start-button:active {
    border: 1px inset #c0c0c0;
}

.start-button img {
    width: 16px;
    height: 16px;
}

.taskbar-items {
    flex: 1;
    display: flex;
    gap: 2px;
    margin-left: 4px;
}

.taskbar-item {
    height: 30px;
    padding: 2px 8px;
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    cursor: pointer;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-item.active {
    border: 1px inset #c0c0c0;
    background: #dfdfdf;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
    border: 1px inset #c0c0c0;
    padding: 2px 8px;
    background: #dfdfdf;
}

.tray-item {
    font-size: 12px;
    cursor: pointer;
}

.clock {
    font-size: 11px;
    font-weight: normal;
    min-width: 50px;
    text-align: center;
}

/* Start Menu */
.start-menu {
    position: fixed;
    bottom: 40px;
    left: 2px;
    width: 200px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.start-menu-header {
    background: linear-gradient(90deg, #000080, #0040c0);
    color: white;
    padding: 8px;
    font-weight: bold;
}

.start-menu-items {
    padding: 4px 0;
}

.start-menu-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    gap: 8px;
}

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

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Tree View */
.tree-view {
    border: 1px inset #c0c0c0;
    background: white;
    padding: 4px;
    font-size: 11px;
}

.tree-view details {
    margin: 2px 0;
}

.tree-view summary {
    cursor: pointer;
    padding: 2px;
}

.tree-view summary:hover {
    background: #e0e0e0;
}

.tree-view ul {
    margin-left: 16px;
    list-style: none;
    padding: 0;
}

.tree-view li {
    padding: 1px 0;
    font-family: 'Courier New', monospace;
}

/* Form Enhancements */
.field-row {
    display: flex;
    align-items: center;
    margin: 8px 0;
    gap: 8px;
}

.field-row label {
    font-size: 11px;
    font-weight: bold;
    min-width: 80px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .desktop-icons {
        flex-direction: row;
        flex-wrap: wrap;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .desktop-icon {
        width: 60px;
    }
    
    .window {
        left: 10px !important;
        top: 50px !important;
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
    }
    
    .taskbar-items {
        display: none;
    }
    
    .start-menu {
        width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
    }
    
    .icon-image {
        font-size: 24px;
    }
    
    .icon-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        text-align: center;
        min-width: 0;
    }
    
    .title-bar-text {
        font-size: 10px;
    }
    
    .window-body {
        padding: 4px;
    }
    
    .tab-content {
        padding: 4px;
        font-size: 11px;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .terminal-cursor {
        animation: none;
    }
    
    .desktop-icon {
        transition: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .desktop {
        background: #000080;
    }
    
    .window {
        border: 3px solid #ffffff;
    }
    
    .title-bar {
        background: #000000;
        border: 1px solid #ffffff;
    }
}

/* Print Styles */
@media print {
    .desktop {
        background: white;
    }
    
    .taskbar,
    .start-menu,
    .title-bar-controls {
        display: none;
    }
    
    .window {
        position: static;
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
}