/* SandboxOS Web - Main Styles */

:root {
    --bg-light: #F0F0F0;
    --bg-dark: #1E1E1E;
    --secondary-light: #FFFFFF;
    --secondary-dark: #2D2D2D;
    --accent-color: #007AFF;
    --text-light: #000000;
    --text-dark: #FFFFFF;
    --hover-light: #E0E0E0;
    --hover-dark: #3E3E3E;
    --dock-bg: #2C2C2E;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    background: var(--bg-light);
    color: var(--text-light);
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Menu Bar */
.menu-bar {
    height: 25px;
    background: var(--secondary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 13px;
    border-bottom: 1px solid #ddd;
    position: relative;
    z-index: 1000;
}

body.dark-mode .menu-bar {
    background: var(--secondary-dark);
    border-bottom-color: #444;
}

.menu-items {
    display: flex;
    gap: 15px;
}

.menu-item {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    user-select: none;
}

.menu-item:hover {
    background: var(--hover-light);
}

body.dark-mode .menu-item:hover {
    background: var(--hover-dark);
}

.menu-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Desktop */
.desktop {
    position: relative;
    height: calc(100vh - 25px - 25px - 70px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

body.dark-mode .desktop {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    gap: 20px;
    padding: 10px;
}

.desktop-icon {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.desktop-icon.selected {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.desktop-icon:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.desktop-icon .icon {
    font-size: 48px;
    margin-bottom: 5px;
}

.desktop-icon .label {
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Windows Container */
#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Window */
.window {
    position: absolute;
    min-width: 400px;
    min-height: 300px;
    background: var(--secondary-light);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.window:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
}

body.dark-mode .window {
    background: var(--secondary-dark);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.window-title-bar {
    height: 36px;
    background: var(--secondary-light);
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: move;
    user-select: none;
}

body.dark-mode .window-title-bar {
    background: var(--secondary-dark);
    border-bottom-color: #444;
}

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

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.window-control:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.window-control.close {
    background: #FF5F57;
}

.window-control.minimize {
    background: #FFBD2E;
}

.window-control.maximize {
    background: #28CA42;
}

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

.window-content {
    flex: 1;
    overflow: auto;
    background: var(--bg-light);
}

body.dark-mode .window-content {
    background: var(--bg-dark);
}

/* Status Bar */
.status-bar {
    height: 25px;
    background: var(--secondary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    border-top: 1px solid #ddd;
}

body.dark-mode .status-bar {
    background: var(--secondary-dark);
    border-top-color: #444;
}

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

/* Dock */
.dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(44, 44, 46, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    z-index: 999;
}

.dock-container {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.dock-item {
    font-size: 48px;
    cursor: pointer;
    transition: transform 0.3s ease-out, margin 0.2s;
    position: relative;
    user-select: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.dock-item:hover {
    transform: scale(1.4) translateY(-15px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.dock-item:active {
    transform: scale(1.2) translateY(-10px);
}

.dock-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 4px;
    border-radius: 8px;
}

.dock-separator {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 5px;
}

/* Notifications */
#notifications-container {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--dock-bg);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.notification-message {
    font-size: 13px;
    opacity: 0.9;
}

/* Spotlight */
.spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15%;
    z-index: 9999;
}

.spotlight-overlay.hidden {
    display: none;
}

.spotlight-container {
    width: 600px;
    background: var(--secondary-light);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

body.dark-mode .spotlight-container {
    background: var(--secondary-dark);
}

.spotlight-search {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
}

.spotlight-results {
    max-height: 400px;
    overflow-y: auto;
}

.spotlight-result {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #ddd;
}

body.dark-mode .spotlight-result {
    border-top-color: #444;
}

.spotlight-result:hover {
    background: var(--hover-light);
}

body.dark-mode .spotlight-result:hover {
    background: var(--hover-dark);
}

.spotlight-result-icon {
    font-size: 32px;
}

/* Launchpad */
.launchpad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.launchpad-overlay.hidden {
    display: none;
}

.launchpad-grid {
    display: grid;
    grid-template-columns: repeat(6, 120px);
    gap: 40px;
    padding: 40px;
}

.launchpad-app {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.launchpad-app:hover {
    transform: scale(1.1);
}

.launchpad-app-icon {
    font-size: 80px;
    margin-bottom: 10px;
}

.launchpad-app-name {
    color: white;
    font-size: 14px;
}

/* Mission Control */
.mission-control-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    z-index: 9997;
}

.mission-control-overlay.hidden {
    display: none;
}

.mission-control-container {
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mc-header {
    color: white;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
}

.mc-desktops {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.mc-desktop {
    width: 200px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.mc-desktop:hover {
    transform: scale(1.05);
}

.mc-windows {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    overflow-y: auto;
}

.mc-window {
    aspect-ratio: 16/10;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.mc-window:hover {
    transform: scale(1.05);
}

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

.button {
    padding: 8px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.button:hover {
    opacity: 0.9;
}

.button-secondary {
    background: var(--secondary-light);
    color: var(--text-light);
}

body.dark-mode .button-secondary {
    background: var(--secondary-dark);
    color: var(--text-dark);
}

input, textarea, select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: var(--secondary-light);
    color: var(--text-light);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: var(--secondary-dark);
    color: var(--text-dark);
    border-color: #444;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
