:root {
    --primary-color: #6200ee;
    --secondary-color: #03dac6;
    --dark-color: #121212;
    --dark-surface: #1e1e1e;
    --darker-surface: #252525;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: #3c3c3c;
    --success-color: #00c853;
    --error-color: #ff5252;
    --warning-color: #ffd600;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --font-mono: 'Roboto Mono', monospace;
    --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--dark-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--dark-surface);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.btn {
    background-color: var(--darker-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.btn.primary {
    background-color: var(--primary-color);
    border: none;
}

.btn.primary:hover {
    background-color: #7626ff;
}

.ai-btn {
    display: flex;
    align-items: center;
    background-color: rgba(3, 218, 198, 0.1);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.ai-btn:hover {
    background-color: rgba(3, 218, 198, 0.2);
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    background-color: var(--dark-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.file-explorer {
    padding: 1rem;
}

.file-explorer h3 {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.file-tree {
    font-size: 0.9rem;
}

.file-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.file-item.active {
    background-color: rgba(98, 0, 238, 0.2);
}

.file-icon {
    color: var(--text-secondary);
    width: 16px;
}

.folder-item {
    font-weight: bold;
    margin-top: 0.5rem;
}

.editor-container {
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.preview-container {
    width: 45%;
    background-color: var(--dark-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.os-settings-btn {
    background-color: rgba(3, 218, 198, 0.1);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.os-settings-btn:hover {
    background-color: rgba(3, 218, 198, 0.2);
}

.small-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.small-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.preview-screen {
    flex: 1;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

.os-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

.hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.widget-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-top: 0.5rem;
}

.widget {
    background-color: var(--darker-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    min-width: 100px;
    max-width: 200px;
    min-height: 60px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.widget:hover {
    border-color: var(--secondary-color);
}

.widget-title {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: var(--secondary-color);
}

.widget-content {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.update-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--success-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.update-badge.visible {
    opacity: 1;
}

.ai-assistant-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--dark-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    z-index: 100;
}

.ai-assistant-panel.active {
    right: 0;
}

.ai-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

.ai-conversation {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message, .user-message {
    display: flex;
    gap: 1rem;
}

.ai-message.loading .message-content {
    background-color: rgba(98, 0, 238, 0.1);
    border-left: 3px solid var(--primary-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ai-avatar, .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar {
    background-color: var(--secondary-color);
}

.ai-avatar svg, .user-avatar svg {
    width: 20px;
    height: 20px;
    color: white;
}

.message-content {
    padding: 0.75rem;
    background-color: var(--darker-surface);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: calc(100% - 50px);
}

.user-message .message-content {
    background-color: rgba(3, 218, 198, 0.1);
}

.message-content ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.message-content strong {
    color: var(--secondary-color);
    font-weight: bold;
}

.ai-input {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.ai-input textarea {
    flex: 1;
    background-color: var(--darker-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    color: var(--text-primary);
    resize: none;
    font-family: var(--font-sans);
    height: 80px;
}

.ai-input button {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 4px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    align-self: flex-end;
}

.ai-input button svg {
    width: 20px;
    height: 20px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: var(--dark-surface);
    margin: 15% auto;
    padding: 1.5rem;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
}

.modal-body input, .modal-body select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--darker-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.os-settings-panel {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    background-color: var(--dark-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 20;
    display: none;
}

.os-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-group {
    margin-bottom: 1rem;
}

.settings-group h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.settings-input {
    width: 60%;
    padding: 0.5rem;
    background-color: var(--darker-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.compress-toggle {
    margin-left: auto;
    background-color: var(--darker-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.compress-toggle svg {
    width: 12px;
    height: 12px;
}

.compressed .editor-container {
    flex: 0.7;
}

.compressed .preview-container {
    width: 55%;
}

/* Code editor customizations */
.monaco-editor .monaco-editor-background,
.monaco-editor .margin-view-overlays {
    background-color: var(--dark-surface) !important;
}

.monaco-editor .line-numbers {
    color: var(--text-secondary) !important;
}