/* Compiler Page Styles */
.compiler-section {
    padding: 6rem 0 4rem;
    min-height: 100vh;
}

.compiler-header {
    text-align: center;
    margin-bottom: 3rem;
}

.compiler-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.compiler-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.compiler-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.language-selector select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.language-selector select:focus {
    border-color: var(--primary-color);
}

.compiler-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.compiler-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.code-panel,
.output-panel {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.panel-header {
    background: var(--dark-bg);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.editor-controls,
.output-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-editor {
    position: relative;
    height: 500px;
    display: flex;
}

.line-numbers {
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 1rem 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-light);
    min-width: 50px;
    text-align: right;
    user-select: none;
}

#codeEditor {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    background: white;
    color: var(--text-primary);
}

.output-content {
    height: 500px;
    position: relative;
}

.output-text {
    height: 100%;
    padding: 1rem;
    background: var(--dark-card);
    color: #e2e8f0;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-y: auto;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

/* Code Examples */
.code-examples {
    margin-top: 4rem;
}

.code-examples h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.example-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.example-card h3 {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.example-card pre {
    background: var(--dark-card);
    color: #e2e8f0;
    padding: 1.5rem;
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    height: 200px;
}

.example-card .btn {
    margin: 1rem;
    width: calc(100% - 2rem);
}

/* Syntax Highlighting */
.keyword {
    color: #c792ea;
}

.string {
    color: #c3e88d;
}

.comment {
    color: #546e7a;
    font-style: italic;
}

.function {
    color: #82aaff;
}

.number {
    color: #f78c6c;
}

/* Dark Theme */
.compiler-section.dark-theme .code-panel,
.compiler-section.dark-theme .output-panel {
    background: var(--dark-card);
}

.compiler-section.dark-theme #codeEditor {
    background: var(--dark-card);
    color: #e2e8f0;
}

.compiler-section.dark-theme .line-numbers {
    background: var(--dark-bg);
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.1);
}

.compiler-section.dark-theme .compiler-toolbar {
    background: var(--dark-card);
}

.compiler-section.dark-theme .language-selector select {
    background: var(--dark-bg);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Error States */
.output-text.error {
    color: #ff6b6b;
}

.output-text.success {
    color: #51cf66;
}

/* Animation for running code */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.running {
    animation: pulse 1s infinite;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .compiler-layout {
        grid-template-columns: 1fr;
    }
    
    .compiler-toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .compiler-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .code-editor,
    .output-content {
        height: 300px;
    }
    
    .example-card pre {
        height: 150px;
    }
}

/* Custom Scrollbar */
.output-text::-webkit-scrollbar,
#codeEditor::-webkit-scrollbar {
    width: 6px;
}

.output-text::-webkit-scrollbar-track,
#codeEditor::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.output-text::-webkit-scrollbar-thumb,
#codeEditor::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.output-text::-webkit-scrollbar-thumb:hover,
#codeEditor::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}