/* Modern Compiler Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #25265e;
    overflow-x: hidden;
}

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

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-title-wrapper {
    font-size: 1.5rem;
    font-weight: 600;
}

.logo-link {
    text-decoration: none;
    color: #25265e;
}

/* Mobile Top Bar */
.mobile-top-bar {
    display: none;
    background: #25265e;
    padding: 0.75rem 1rem;
    justify-content: space-between;
    align-items: center;
}

.pills-wrapper {
    display: flex;
}

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

.pill {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pill.active {
    background: rgba(255,255,255,0.2);
}

.options-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.options-item-wrapper, .share-button-mob, .mobile-top-bar-run-button {
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-top-bar-run-button {
    background: #28a745;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

/* Main Wrapper */
.wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 1px;
    background: #e9ecef;
}

/* Sidebar */
.sidebar-wrapper {
    background: #25265e;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 0.5rem;
}

.change-lang-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.change-lang-btn:hover, .change-lang-btn.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.lang-icon {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Editor Wrapper */
.editor-wrapper {
    background: white;
    display: flex;
    flex-direction: column;
}

.editor-desktop-top-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-weight: 500;
    color: #25265e;
}

.desktop-top-bar__btn-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.desktop-top-bar__btn-wrapper button {
    background: none;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.desktop-top-bar__btn-wrapper button:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.desktop-run-button {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.desktop-run-button:hover {
    background: #218838 !important;
}

#editor {
    flex: 1;
    min-height: 400px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Examples */
.examples-wrapper {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.examples-wrapper h3 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.examples-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.example-btn {
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.example-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Terminal Wrapper */
.terminal-wrapper {
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
}

.terminal-desktop-top-bar {
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shell-name {
    color: #cccccc;
    font-weight: 500;
}

.terminal-desktop-top-bar__btn-wrapper button {
    background: none;
    border: 1px solid #3e3e42;
    color: #cccccc;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.terminal-desktop-top-bar__btn-wrapper button:hover {
    background: #3e3e42;
}

#terminal {
    flex: 1;
    min-height: 400px;
    background: #1e1e1e;
    color: #cccccc;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    padding: 1rem;
    overflow-y: auto;
}

/* Dark Mode */
body.dark-mode {
    background: #1e1e1e;
    color: #cccccc;
}

body.dark-mode .header {
    background: #2d2d30;
    border-color: #3e3e42;
}

body.dark-mode .editor-wrapper {
    background: #252526;
}

body.dark-mode .editor-desktop-top-bar {
    background: #2d2d30;
    border-color: #3e3e42;
}

body.dark-mode .examples-wrapper {
    background: #2d2d30;
    border-color: #3e3e42;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-top-bar {
        display: flex;
    }
    
    .wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
    
    .sidebar-wrapper {
        display: none;
    }
    
    .header {
        padding: 1rem;
    }
    
    .editor-desktop-top-bar {
        display: none;
    }
    
    .terminal-desktop-top-bar {
        display: none;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #25265e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.success {
    color: #28a745;
}

.error {
    color: #dc3545;
}

.output-line {
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
}

.error-line {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 0.25rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}