/* Windows XP Styling */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Tahoma', 'MS Sans Serif', 'Segoe UI', sans-serif;
    font-size: 11px;
    overflow: hidden;
}

.windows-desktop {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: linear-gradient(to bottom, #245EDC 0%, #3B82C4 25%, #4A90D4 50%, #6BA6E3 75%, #87CEEB 100%);
}

/* Main Window */
.windows-window {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 60px;
    background: #ECE9D8;
    border: 1px solid #0054E3;
    border-radius: 8px 8px 0 0;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Title Bar */
.window-titlebar {
    height: 32px;
    background: linear-gradient(to bottom, #0054E3 0%, #0099FF 50%, #0054E3 100%);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: white;
    font-weight: bold;
}

.window-title {
    display: flex;
    align-items: center;
    font-size: 11px;
}

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

.window-control-button {
    width: 21px;
    height: 21px;
    background: linear-gradient(to bottom, #DDD 0%, #BBB 100%);
    border: 1px solid #999;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-control-button:hover {
    background: linear-gradient(to bottom, #EEE 0%, #CCC 100%);
}

.window-control-button.close {
    background: linear-gradient(to bottom, #FF6B6B 0%, #E53E3E 100%);
    color: white;
}

/* Menu Bar */
.menu-bar {
    height: 24px;
    background: #ECE9D8;
    border-bottom: 1px solid #ACA899;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

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

.menu-item:hover {
    background: #316AC5;
    color: white;
}

/* Toolbar */
.toolbar {
    height: 32px;
    background: #ECE9D8;
    border-bottom: 1px solid #ACA899;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
}

.toolbar-nav {
    display: flex;
    gap: 2px;
}

.address-bar {
    flex: 1;
    height: 22px;
    background: white;
    border: 2px inset #ECE9D8;
    padding: 2px 4px;
    font-size: 11px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Windows Button */
.windows-button {
    background: linear-gradient(to bottom, #ECE9D8 0%, #D6D3CE 50%, #C3C7CB 100%);
    border: 1px outset #ECE9D8;
    padding: 4px 12px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}

.windows-button:hover {
    background: linear-gradient(to bottom, #F2EFE8 0%, #DCDAD5 50%, #C8CCCE 100%);
}

.windows-button:active,
.windows-button.pressed {
    border: 1px inset #ECE9D8;
    background: linear-gradient(to bottom, #D6D3CE 0%, #ECE9D8 100%);
}

.windows-button:disabled,
.windows-button.disabled {
    opacity: 0.5;
    cursor: default;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #ECE9D8;
    border-right: 1px solid #ACA899;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

.sidebar-panel {
    background: #E1DDD9;
    border: 1px solid #ACA899;
    border-radius: 4px;
}

.panel-header {
    background: linear-gradient(to bottom, #FFEAA7 0%, #FDCB6E 100%);
    padding: 6px 8px;
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px solid #ACA899;
}

.panel-content {
    padding: 8px;
}

.task-item,
.place-item {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    border-radius: 2px;
}

.task-item:hover,
.place-item:hover {
    background: #316AC5;
    color: white;
}

/* Game Area */
.game-area {
    flex: 1;
    background: white;
    position: relative;
    overflow: auto;
}

.generating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 14px;
    color: #333;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
    padding: 16px;
}

/* Game Icons */
.game-icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    padding: 8px;
    border-radius: 4px;
}

.game-icon:hover {
    background: #E3F2FD;
}

.game-icon.selected {
    background: #316AC5;
    color: white;
}

.icon-image {
    width: 48px;
    height: 48px;
    margin: 0 auto 4px;
    background: linear-gradient(to bottom, #F0F0F0 0%, #D0D0D0 100%);
    border: 1px solid #999;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-label {
    font-size: 11px;
    font-weight: normal;
    margin-bottom: 2px;
    word-wrap: break-word;
    line-height: 1.2;
}

.icon-details {
    font-size: 9px;
    opacity: 0.7;
    line-height: 1.1;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #F6F4F1;
    border: 1px solid #716F64;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 150px;
    font-size: 11px;
}

.context-menu-item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: #316AC5;
    color: white;
}

.context-menu-separator {
    height: 1px;
    background: #ACA899;
    margin: 2px 0;
}

/* Status Bar */
.status-bar {
    height: 24px;
    background: #ECE9D8;
    border-top: 1px solid #ACA899;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    gap: 16px;
}

.status-text {
    flex: 1;
}

.status-selection {
    opacity: 0.7;
}

/* Taskbar */
.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, #245EDC 0%, #1E4BC7 100%);
    border-top: 1px solid #4A90D4;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 4px;
}

.start-button {
    height: 32px;
    background: linear-gradient(to bottom, #3CB371 0%, #2E8B57 100%);
    border: 1px outset #3CB371;
    border-radius: 4px;
    padding: 0 12px;
    color: white;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.start-button:hover {
    background: linear-gradient(to bottom, #4CBB81 0%, #3E9B67 100%);
}

.taskbar-apps {
    flex: 1;
    display: flex;
    gap: 4px;
}

.taskbar-app {
    height: 24px;
    background: linear-gradient(to bottom, #E1DDD9 0%, #C3C7CB 100%);
    border: 1px outset #E1DDD9;
    padding: 0 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.taskbar-app.active {
    border: 1px inset #E1DDD9;
    background: linear-gradient(to bottom, #C3C7CB 0%, #E1DDD9 100%);
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tray-time {
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

/* Dialog Styling */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-window {
    width: 480px;
    background: #ECE9D8;
    border: 1px solid #0054E3;
    border-radius: 8px 8px 0 0;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.5);
}

.dialog-titlebar {
    height: 32px;
    background: linear-gradient(to bottom, #0054E3 0%, #0099FF 50%, #0054E3 100%);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: white;
    font-weight: bold;
}

.dialog-title {
    font-size: 11px;
}

.dialog-close {
    width: 21px;
    height: 21px;
    background: linear-gradient(to bottom, #FF6B6B 0%, #E53E3E 100%);
    border: 1px solid #999;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-content {
    padding: 16px;
}

.dialog-field {
    margin-bottom: 12px;
}

.dialog-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: bold;
}

.dialog-textarea,
.dialog-select {
    width: 100%;
    border: 2px inset #ECE9D8;
    padding: 4px;
    font-size: 11px;
    font-family: inherit;
}

.dialog-textarea {
    resize: vertical;
    min-height: 60px;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* Game Player */
.game-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.game-player-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.game-player-window {
    width: 90%;
    height: 90%;
    max-width: 1024px;
    max-height: 768px;
    background: #ECE9D8;
    border: 1px solid #0054E3;
    border-radius: 8px 8px 0 0;
    box-shadow: 8px 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.game-player-content {
    flex: 1;
    position: relative;
    background: white;
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-iframe.hidden {
    display: none;
}

.game-loading,
.game-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #F0F0F0;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-text {
    font-size: 14px;
    color: #666;
}

/* Windows Progress Bar */
.windows-progress-bar {
    width: 300px;
    height: 20px;
    background: white;
    border: 2px inset #ECE9D8;
    position: relative;
    overflow: hidden;
}

.windows-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(to right, transparent, #316AC5, transparent);
    animation: progressBarSlide 2s infinite;
}

@keyframes progressBarSlide {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 12px;
    }
    
    .game-icon {
        width: 70px;
    }
    
    .sidebar {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .windows-window {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 50px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 120px;
        border-right: none;
        border-bottom: 1px solid #ACA899;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-panel {
        min-width: 200px;
    }
}