/* Mac OS Cheetah GUI Styles */

/* Desktop Environment */
.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4a90e2 0%, #7cb3e9 50%, #a8d5f7 100%);
    display: none;
    flex-direction: column;
    z-index: 2000;
    font-family: 'Lucida Grande', 'Helvetica Neue', Arial, sans-serif;
}

.desktop.active {
    display: flex;
}

/* Menu Bar */
.menu-bar {
    height: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(230, 230, 230, 0.95) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 13px;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.menu-bar .apple-menu {
    font-size: 16px;
    margin-right: 15px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
}

.menu-bar .apple-menu:hover {
    background: rgba(0, 0, 0, 0.1);
}

.menu-bar .menu-item {
    padding: 2px 12px;
    cursor: pointer;
    border-radius: 3px;
    margin-right: 5px;
    font-weight: 500;
}

.menu-bar .menu-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.menu-bar .menu-spacer {
    flex: 1;
}

.menu-bar .menu-right {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

/* Menu Dropdown */
.menu-dropdown {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    padding: 4px 0;
    z-index: 3000;
    font-size: 13px;
}

.menu-dropdown-item {
    padding: 6px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}

.menu-dropdown-item:hover:not(.disabled) {
    background: rgba(74, 144, 226, 0.8);
    color: #fff;
}

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

.menu-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

.menu-shortcut {
    font-size: 11px;
    color: #666;
    margin-left: 20px;
}

.menu-dropdown-item:hover:not(.disabled) .menu-shortcut {
    color: rgba(255, 255, 255, 0.8);
}

/* Desktop Context Menu */
.desktop-context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    padding: 4px 0;
    z-index: 3000;
    font-size: 13px;
}

.context-menu-item {
    padding: 6px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.context-menu-item:hover {
    background: rgba(74, 144, 226, 0.8);
    color: #fff;
}

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

.context-menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

/* Desktop Icons */
.desktop-content {
    flex: 1;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.desktop-icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    user-select: none;
}

.desktop-icon .icon-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 5px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.desktop-icon .icon-label {
    color: #fff;
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.3);
    display: inline-block;
}

.desktop-icon:hover .icon-image {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.desktop-icon.selected .icon-label {
    background: rgba(0, 100, 200, 0.7);
}

/* Window */
.window {
    position: absolute;
    background: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    min-height: 300px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.window.active {
    display: flex;
    z-index: 100;
}

.window.minimized {
    transform: scale(0.1);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

.window.maximized {
    top: 24px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 24px) !important;
    border-radius: 0;
}

/* Resize Handle */
.window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 10;
}

.window-resize-handle::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, transparent 0%, transparent 40%, #999 40%, #999 45%, transparent 45%, transparent 55%, #999 55%, #999 60%, transparent 60%);
}

/* Window Title Bar */
.window-titlebar {
    height: 22px;
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
    border-bottom: 1px solid #999;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: move;
    user-select: none;
}

.window.focused .window-titlebar {
    background: linear-gradient(180deg, #b4b4b4 0%, #8a8a8a 100%);
}

.window-controls {
    display: flex;
    gap: 6px;
    margin-right: 10px;
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.window-control.close {
    background: linear-gradient(135deg, #ff5f57 0%, #ff3b30 100%);
}

.window-control.minimize {
    background: linear-gradient(135deg, #ffbd2e 0%, #ff9500 100%);
}

.window-control.maximize {
    background: linear-gradient(135deg, #28c940 0%, #00c957 100%);
}

.window-control:hover {
    filter: brightness(1.1);
}

.window-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.window.focused .window-title {
    color: #fff;
}

/* Window Content */
.window-content {
    flex: 1;
    overflow: auto;
    background: #fff;
}

/* Text Viewer */
.text-viewer {
    padding: 20px;
    font-family: 'Lucida Grande', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.text-viewer h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #000;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 5px;
}

.text-viewer h2 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.text-viewer p {
    margin-bottom: 10px;
}

.text-viewer .info-row {
    display: flex;
    margin-bottom: 8px;
}

.text-viewer .info-label {
    font-weight: 600;
    min-width: 100px;
    color: #555;
}

.text-viewer .info-value {
    color: #000;
}

.text-viewer a {
    color: #4a90e2;
    text-decoration: none;
}

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

.text-viewer ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.text-viewer li {
    margin-bottom: 5px;
}

/* Dock */
.dock {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dock-item {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dock-item:hover {
    transform: scale(1.2) translateY(-5px);
}

.dock-item.active {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.5);
}

/* Scrollbar */
.window-content::-webkit-scrollbar {
    width: 15px;
}

.window-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c0c0c0 0%, #a0a0a0 100%);
    border-radius: 8px;
    border: 2px solid #f0f0f0;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #b0b0b0 0%, #909090 100%);
}

/* Animations */
@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.window.opening {
    animation: windowOpen 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .window {
        min-width: 90%;
        width: 90% !important;
    }

    .dock {
        bottom: 5px;
        padding: 6px;
    }

    .dock-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* About Dialog */
.about-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4);
    padding: 30px;
    min-width: 400px;
    z-index: 3000;
    font-family: 'Lucida Grande', Arial, sans-serif;
}

.about-dialog h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

.about-dialog .about-icon {
    text-align: center;
    font-size: 64px;
    margin-bottom: 15px;
}

.about-dialog .about-info {
    margin-bottom: 12px;
    display: flex;
    font-size: 13px;
}

.about-dialog .about-label {
    font-weight: 600;
    min-width: 120px;
    color: #555;
}

.about-dialog .about-value {
    color: #000;
    flex: 1;
}

.about-dialog .about-close {
    margin-top: 20px;
    text-align: center;
}

.about-dialog .about-close button {
    background: linear-gradient(180deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.about-dialog .about-close button:hover {
    background: linear-gradient(180deg, #357abd 0%, #2868a8 100%);
}

.about-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2999;
}

/* Terminal Window Styles */
.terminal-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e1e;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.terminal-window-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    color: #00ff00;
    font-size: 13px;
    line-height: 1.5;
}

.terminal-window-input-line {
    display: flex;
    padding: 10px;
    background: #2a2a2a;
    border-top: 1px solid #444;
}

.terminal-window-prompt {
    color: #4a90e2;
    margin-right: 8px;
    white-space: nowrap;
}

.terminal-window-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #00ff00;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
}

.terminal-window-output::-webkit-scrollbar {
    width: 10px;
}

.terminal-window-output::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.terminal-window-output::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

.terminal-window-output::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Photo Attribution */
.photo-attribution {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.photo-attribution a {
    color: #4a90e2;
    text-decoration: none;
}

.photo-attribution a:hover {
    text-decoration: underline;
}

/* Preferences Window */
.preferences-content {
    padding: 20px;
    font-family: 'Lucida Grande', Arial, sans-serif;
}

.preferences-section {
    margin-bottom: 20px;
}

.preferences-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.search-bar input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-bar button {
    padding: 8px 16px;
    background: linear-gradient(180deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.search-bar button:hover {
    background: linear-gradient(180deg, #357abd 0%, #2868a8 100%);
}

.search-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.photo-item.selected {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 8px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-item:hover .photo-item-info {
    opacity: 1;
}

.photo-grid::-webkit-scrollbar {
    width: 10px;
}

.photo-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 5px;
}

.photo-grid::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 5px;
}

.photo-grid::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.apply-button {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(180deg, #28c940 0%, #00c957 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.apply-button:hover {
    background: linear-gradient(180deg, #00c957 0%, #00b34d 100%);
}

.apply-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 13px;
}

.error-message {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #cc0000;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Desktop with custom background */
.desktop.custom-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Browser Window Styles */
.browser-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.browser-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    align-items: center;
}

.browser-btn {
    padding: 6px 12px;
    background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    min-width: 32px;
}

.browser-btn:hover {
    background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
}

.browser-btn:active {
    background: linear-gradient(180deg, #d0d0d0 0%, #c0c0c0 100%);
}

.browser-address-bar {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #999;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Lucida Grande', Arial, sans-serif;
    outline: none;
}

.browser-address-bar:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.browser-loading {
    padding: 8px;
    background: #fffacd;
    border-bottom: 1px solid #f0e68c;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.browser-error {
    padding: 8px;
    background: #ffe6e6;
    border-bottom: 1px solid #ffcccc;
    color: #cc0000;
    font-size: 12px;
    text-align: center;
}

.browser-iframe {
    flex: 1;
    border: none;
    width: 100%;
    background: #fff;
}

/* Nano Editor Styles */
.nano-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e1e;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.nano-editor {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.nano-textarea {
    flex: 1;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    outline: none;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    tab-size: 4;
}

.nano-statusbar {
    display: flex;
    justify-content: space-between;
    padding: 4px 10px;
    background: #2a2a2a;
    border-top: 1px solid #444;
    font-size: 12px;
    color: #aaa;
}

.nano-status-left {
    display: flex;
    gap: 10px;
}

.nano-modified {
    color: #ff9500;
    font-weight: bold;
}

.nano-help {
    display: flex;
    gap: 15px;
    padding: 4px 10px;
    background: #2a2a2a;
    border-top: 1px solid #444;
    font-size: 11px;
    color: #888;
    flex-wrap: wrap;
}

.nano-help span {
    white-space: nowrap;
}

.nano-message {
    padding: 6px 10px;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #444;
}

.nano-message.success {
    background: #28c940;
    color: #fff;
}

.nano-message.error {
    background: #ff3b30;
    color: #fff;
}

.nano-message.info {
    background: #4a90e2;
    color: #fff;
}