/* System 7 Classic Mac OS Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Chicago', 'Geneva', -apple-system, sans-serif;
    font-size: 12px;
    background: #C0C0C0;
    overflow: hidden;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: white;
    border-bottom: 1px solid black;
    display: flex;
    align-items: center;
    padding: 0 4px;
    z-index: 10000;
    font-size: 12px;
}

.menu-item {
    padding: 2px 8px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.menu-item:hover {
    background: black;
    color: white;
}

.menu-item.apple {
    font-size: 14px;
}

.menu-dropdown {
    position: absolute;
    top: 20px;
    left: 0;
    background: white;
    border: 2px solid black;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    min-width: 180px;
    z-index: 10001;
}

.menu-dropdown-item {
    padding: 4px 20px 4px 12px;
    cursor: pointer;
    border-bottom: 1px solid #CCC;
}

.menu-dropdown-item:last-child {
    border-bottom: none;
}

.menu-dropdown-item:hover {
    background: black;
    color: white;
}

.menu-dropdown-item.disabled {
    color: #999;
    cursor: default;
}

.menu-dropdown-item.disabled:hover {
    background: white;
    color: #999;
}

/* Desktop */
.desktop {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    bottom: 20px;
    background: #C0C0C0;
    overflow: hidden;
}

/* Windows */
.window {
    position: absolute;
    background: white;
    border: 1px solid black;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    min-width: 200px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

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

.window-title-bar {
    height: 20px;
    background: white;
    border-bottom: 1px solid black;
    display: flex;
    align-items: center;
    cursor: move;
    user-select: none;
    position: relative;
}

.window.active .window-title-bar {
    background: repeating-linear-gradient(
        90deg,
        black,
        black 1px,
        white 1px,
        white 2px
    );
}

.window-title {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
}

.window.active .window-title {
    color: white;
}

.window-controls {
    position: absolute;
    left: 4px;
    display: flex;
    gap: 4px;
}

.window-control {
    width: 12px;
    height: 12px;
    border: 1px solid black;
    background: white;
    cursor: pointer;
}

.window-control:active {
    background: black;
}

.window-content {
    flex: 1;
    overflow: auto;
    padding: 8px;
}

.window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 40%, black 40%, black 45%, transparent 45%, transparent 55%, black 55%, black 60%, transparent 60%);
}

/* Buttons */
.button {
    padding: 4px 16px;
    border: 2px solid black;
    background: #DDD;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    box-shadow: inset -1px -1px 0 rgba(0,0,0,0.3), inset 1px 1px 0 white;
}

.button:active {
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.3), inset -1px -1px 0 white;
    background: #BBB;
}

.button:disabled {
    color: #999;
    cursor: default;
}

.button-primary {
    border: 3px solid black;
}

/* Input Fields */
.input-field {
    padding: 4px 8px;
    border: 2px solid black;
    background: white;
    font-family: inherit;
    font-size: 12px;
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.3);
}

.input-field:focus {
    outline: 2px dotted black;
    outline-offset: -4px;
}

/* List View */
.list-view {
    border: 2px solid black;
    background: white;
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.3);
    overflow-y: auto;
    max-height: 400px;
}

.list-item {
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #EEE;
}

.list-item:hover {
    background: #F0F0F0;
}

.list-item.selected {
    background: black;
    color: white;
}

.list-item-icon {
    font-size: 16px;
}

/* Scrollbar */
.list-view::-webkit-scrollbar {
    width: 16px;
}

.list-view::-webkit-scrollbar-track {
    background: white;
    border-left: 1px solid black;
}

.list-view::-webkit-scrollbar-thumb {
    background: #DDD;
    border: 1px solid black;
}

.list-view::-webkit-scrollbar-thumb:active {
    background: #999;
}

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

.dialog {
    background: white;
    border: 2px solid black;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.5);
    padding: 16px;
    min-width: 300px;
    max-width: 500px;
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.dialog-icon {
    font-size: 32px;
}

.dialog-title {
    font-weight: bold;
    font-size: 14px;
}

.dialog-content {
    margin: 12px 0;
    line-height: 1.4;
}

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

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 8px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.gallery-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid black;
    box-shadow: inset 1px 1px 0 rgba(0,0,0,0.3);
}

.gallery-label {
    margin-top: 4px;
    font-size: 10px;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    border: 2px solid black;
    background: #000;
    position: relative;
}

.map-controls {
    position: absolute;
    top: 8px;
    left: 8px;
    background: white;
    border: 2px solid black;
    padding: 4px;
    display: flex;
    gap: 4px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid black;
}

.data-table th {
    background: #DDD;
    border: 1px solid black;
    padding: 4px 8px;
    text-align: left;
    font-weight: bold;
}

.data-table td {
    border: 1px solid #CCC;
    padding: 4px 8px;
}

.data-table tr:nth-child(even) {
    background: #F5F5F5;
}

.data-table tr:hover {
    background: #E0E0E0;
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: #DDD;
    border-top: 1px solid black;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 10px;
    z-index: 10000;
}

.status-bar-section {
    padding: 0 8px;
    border-right: 1px solid #999;
}

.status-bar-section:last-child {
    border-right: none;
    margin-left: auto;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-style: italic;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox {
    width: 14px;
    height: 14px;
    border: 2px solid black;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkbox.checked::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}

/* Radio Button */
.radio-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.radio {
    width: 14px;
    height: 14px;
    border: 2px solid black;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.radio.checked::after {
    content: '';
    width: 8px;
    height: 8px;
    background: black;
    border-radius: 50%;
}

/* Select Dropdown */
.select-field {
    padding: 4px 8px;
    border: 2px solid black;
    background: white;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

/* Form Group */
.form-group {
    margin-bottom: 12px;
}

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

/* API Control Panel */
.control-panel {
    background: #F0F0F0;
    border: 2px solid black;
    padding: 12px;
    margin-bottom: 12px;
}

.control-section {
    margin-bottom: 16px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section-title {
    font-weight: bold;
    margin-bottom: 8px;
    border-bottom: 1px solid #999;
    padding-bottom: 4px;
}

/* Image Viewer */
.image-viewer-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: 99999;
    cursor: pointer;
}

.image-viewer-content {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Progress Bar */
.progress-bar {
    height: 16px;
    border: 2px solid black;
    background: white;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        black,
        black 2px,
        white 2px,
        white 4px
    );
    transition: width 0.3s ease;
}

/* Console Window */
.console-content {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 10px;
    background: black;
    color: #00FF00;
    padding: 8px;
    height: 100%;
    overflow-y: auto;
}

.console-line {
    margin-bottom: 2px;
}

.console-line.error {
    color: #FF4444;
}

.console-line.warning {
    color: #FFAA00;
}

/* Utility Classes */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-12 {
    margin-bottom: 12px;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: bold;
}

/* Link */
a {
    color: #0000EE;
    text-decoration: underline;
}

a:visited {
    color: #551A8B;
}

a:hover {
    color: #EE0000;
}