/* NanoBanana Windows 95 Enhanced Styling */

* {
    box-sizing: border-box;
    font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
    font-size: 11px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

input[type="text"],
textarea,
.win95-input,
.win95-textarea,
.win95-select {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    cursor: default;
}

#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#desktop-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    width: 64px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    padding: 4px;
}

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

.icon-image {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 32px;
    margin-bottom: 4px;
}

.icon-image img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.icon-label {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 2px #000;
    word-wrap: break-word;
}

/* Windows */
.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.window-title-bar {
    background: linear-gradient(to right, #000080, #1084D0);
    color: white;
    padding: 3px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    height: 22px;
}

.window-title {
    font-weight: bold;
    font-size: 11px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.window-control {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-control:hover {
    background: #d4d0c8;
}

.window-control:active {
    border-color: #000000 #ffffff #ffffff #000000;
}

.window-content {
    padding: 4px;
}

.window-content canvas {
    display: block;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #c0c0c0;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    z-index: 10;
}

.resize-handle.resize-se {
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 0%, transparent 40%, #808080 41%, #808080 45%, transparent 46%);
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #c0c0c0;
    border-top: 1px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 1000;
}

#start-button {
    height: 32px;
    padding: 2px 8px;
    margin-right: 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.start-flag-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

#taskbar-buttons {
    flex: 1;
    display: flex;
    gap: 2px;
    overflow-x: auto;
}

.taskbar-button {
    height: 32px;
    padding: 2px 8px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    cursor: pointer;
}

.taskbar-button:hover {
    background: #d4d0c8;
}

#system-tray {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* Windows 95 Button Style */
.win95-button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    color: black;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
    min-width: 75px;
}

.win95-button:hover {
    background: #d4d0c8;
}

.win95-button:active {
    border-color: #000000 #ffffff #ffffff #000000;
}

.win95-button-primary {
    border: 3px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    font-weight: bold;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 42px;
    left: 2px;
    width: 240px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.start-menu-banner {
    background: linear-gradient(to right, #000080, #1084D0);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    float: left;
    height: 100%;
    font-size: 24px;
    letter-spacing: 2px;
}

.start-menu-item {
    padding: 6px 32px 6px 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

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

.menu-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    position: absolute;
    left: 18px;
}

.start-menu-separator {
    height: 1px;
    background: #808080;
    margin: 2px 40px 2px 18px;
}

/* Modal Dialogs */
#modal-overlay,
#settings-modal,
#about-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.win95-dialog {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.dialog-title-bar {
    background: linear-gradient(to right, #000080, #1084D0);
    color: white;
    padding: 3px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    height: 22px;
}

.dialog-close {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.dialog-content {
    padding: 16px;
}

.dialog-content p {
    margin: 0 0 12px 0;
}

.win95-input,
.win95-textarea,
.win95-select {
    width: 100%;
    padding: 4px;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: white;
    font-size: 11px;
    margin-bottom: 12px;
}

.win95-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'Courier New', monospace;
}

.template-section {
    margin: 12px 0;
}

.template-section label {
    display: block;
    margin-bottom: 6px;
}

.help-text {
    background: #ffffc0;
    border: 1px solid #808080;
    padding: 8px;
    margin: 12px 0;
    font-size: 10px;
}

.help-text p {
    margin: 0;
    line-height: 1.4;
}

.help-text code {
    background: #f0f0f0;
    padding: 1px 3px;
    font-family: 'Courier New', monospace;
    border: 1px solid #c0c0c0;
}

.dialog-buttons {
    text-align: right;
    margin-top: 16px;
}

.dialog-buttons .win95-button {
    margin-left: 8px;
}

/* Settings specific */
.settings-section {
    margin-bottom: 20px;
}

.settings-section label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

/* About dialog specific */
.about-content {
    text-align: center;
}

.about-logo {
    margin: 20px 0;
}

.about-logo img {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
}

.about-content h2 {
    margin: 10px 0;
    color: #000080;
}

.about-divider {
    height: 1px;
    background: #808080;
    margin: 16px 0;
}

.about-content ul {
    text-align: left;
    list-style: none;
    padding: 0;
}

.about-content li {
    padding: 4px 0;
}

/* Utility */
.hidden {
    display: none !important;
}

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

::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

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

/* Footer */
.footer {
    position: fixed;
    bottom: 45px;
    right: 10px;
    background: rgba(192, 192, 192, 0.95);
    padding: 4px 8px;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    font-size: 10px;
    z-index: 999;
}

.footer a {
    color: #000080;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .win95-dialog {
        min-width: 90vw;
        max-width: 90vw;
    }
}