/* Windows 95 AI-Enhanced Styles */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    overflow: hidden;
    user-select: none;
}

.desktop {
    background: linear-gradient(45deg, #008080, #40E0D0);
    cursor: default;
}

/* Window 95 Button Styling */
.win-button {
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    color: black;
    font-size: 11px;
    font-family: 'MS Sans Serif', sans-serif;
    cursor: pointer;
    padding: 2px 6px;
}

.win-button:hover {
    background: #D0D0D0;
}

.win-button:active,
.win-button.pressed {
    border: 2px inset #C0C0C0;
    background: #A0A0A0;
}

.win-button:disabled {
    background: #C0C0C0;
    color: #808080;
    cursor: not-allowed;
}

/* Window Styling */
.window95 {
    border: 2px outset #C0C0C0;
    background: #C0C0C0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    resize: both;
    overflow: hidden;
}

.window95-titlebar {
    background: linear-gradient(90deg, #0000FF, #000080);
    border-bottom: 1px solid #808080;
    font-size: 11px;
    height: 20px;
    line-height: 1;
}

.window95-titlebar.bg-gray-500 {
    background: linear-gradient(90deg, #808080, #606060);
}

/* AI Generator Styling */
.ai-generator {
    background: #C0C0C0;
    max-height: 100%;
    overflow-y: auto;
}

.ai-generator textarea,
.ai-generator input,
.ai-generator select {
    border: 2px inset #C0C0C0;
    background: white;
    color: black;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

.ai-generator textarea:focus,
.ai-generator input:focus,
.ai-generator select:focus {
    outline: none;
    background: #FFF8DC;
}

/* Settings Panel */
.settings-panel {
    background: #C0C0C0;
    border: 2px inset #C0C0C0;
    overflow-y: auto;
}

.settings-panel textarea,
.settings-panel input {
    border: 2px inset #C0C0C0;
    background: white;
    font-family: monospace;
    font-size: 10px;
}

/* Taskbar Styling */
.taskbar {
    background: #C0C0C0;
    border-top: 1px solid #DFDFDF;
}

.start-button {
    background: #C0C0C0;
    border: 1px outset #C0C0C0;
    font-weight: bold;
}

.start-button.pressed {
    border: 1px inset #C0C0C0;
}

/* Start Menu */
.start-menu {
    border: 2px outset #C0C0C0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.start-menu-item {
    font-size: 11px;
    padding: 2px 8px;
    white-space: nowrap;
}

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

/* Desktop Icons */
.desktop-icon {
    width: 64px;
    color: white;
    text-shadow: 1px 1px 1px black;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(0, 0, 255, 0.3);
    border: 1px dotted white;
}

/* AI App iframe styling */
iframe {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
}

/* Inset border effect */
.border-inset {
    border: 2px inset #C0C0C0;
}

/* System Tray */
.system-tray {
    background: #C0C0C0;
    border-left: 1px solid #808080;
    padding: 2px 6px;
    font-size: 11px;
}

/* Scrollbars (WebKit) */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #C0C0C0;
    border: 1px inset #C0C0C0;
}

::-webkit-scrollbar-thumb {
    background: #C0C0C0;
    border: 1px outset #C0C0C0;
}

::-webkit-scrollbar-thumb:hover {
    background: #D0D0D0;
}

::-webkit-scrollbar-corner {
    background: #C0C0C0;
}

/* Disable text selection on UI elements */
.taskbar, .start-menu, .window95-titlebar, .win-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in text areas */
textarea, input[type="text"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Authentic Windows 95 form elements */
input, textarea, select {
    border: 2px inset #C0C0C0;
    background: white;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    padding: 1px 3px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    background: #FFF8DC;
}

/* Window controls */
.window-controls button {
    width: 16px;
    height: 14px;
    font-size: 10px;
    font-weight: bold;
    border: 1px outset #C0C0C0;
    background: #C0C0C0;
    color: black;
    cursor: pointer;
}

.window-controls button:active {
    border: 1px inset #C0C0C0;
}

/* Classic hover effects */
button:not(:disabled):hover {
    filter: brightness(1.05);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Pixelated rendering for icons */
img {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Tab styling */
.flex.border-b button {
    background: #C0C0C0;
    border: 1px outset #C0C0C0;
    border-bottom: none;
    margin-right: 1px;
}

.flex.border-b button.border-blue-600 {
    background: white;
    border: 1px inset #C0C0C0;
    border-bottom: 1px solid white;
}

/* Loading and error states */
.loading {
    background: repeating-linear-gradient(
        45deg,
        #C0C0C0,
        #C0C0C0 10px,
        #A0A0A0 10px,
        #A0A0A0 20px
    );
    animation: loading 1s linear infinite;
}

@keyframes loading {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Enhanced submenu styling */
.start-menu .absolute {
    border: 2px outset #C0C0C0;
    background: #C0C0C0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* Radio button styling */
input[type="radio"] {
    border: 2px inset #C0C0C0;
    background: white;
    width: 12px;
    height: 12px;
    margin: 0;
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
    .start-menu {
        width: 180px !important;
    }
    
    .start-menu .absolute {
        width: 160px !important;
    }
    
    .window95 {
        min-width: 250px;
    }
}