/**
 * Python Exercise App - Frontend CSS
 * تنسيق التمرين التفاعلي في Frontend
 */

/* الحاوية الرئيسية */
.exercise-editor-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

/* قسم المحرر */
.editor-section {
    background: #1e1e1e;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cccccc;
    font-size: 14px;
    font-weight: 500;
}

.editor-title svg {
    color: #4ec9b0;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #3e3e42;
    border-color: #007acc;
    color: #ffffff;
}

/* محرر الكود البسيط */
.monaco-editor-wrapper {
    position: relative;
    min-height: 300px;
}

.simple-code-editor {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    outline: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    tab-size: 4;
}

.simple-code-editor:focus {
    background: #1f1f1f;
}

/* أزرار التحكم */
.controls-section {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    margin: 16px 0;
}

.controls-section button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #10b981;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* منطقة النتائج */
.output-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 0 16px;
    overflow: hidden;
}

.output-header {
    padding: 10px 16px;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.output-content {
    padding: 16px;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.output-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-placeholder {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

.output-loading {
    color: #2563eb;
    text-align: center;
    padding: 40px 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.output-success {
    color: #198754;
}

.output-error {
    color: #dc3545;
}

/* نتيجة التحقق */
.validation-result {
    margin: 0 16px 16px;
    padding: 16px;
    border-radius: 6px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-success {
    background: #d1f4e0;
    border: 1px solid #10b981;
}

.validation-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.validation-message {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.validation-similarity {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.validation-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.validation-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #2563eb 100%);
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls-section {
        flex-direction: column;
    }
    
    .controls-section button {
        width: 100%;
        justify-content: center;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .editor-actions {
        width: 100%;
    }
    
    .btn-reset {
        flex: 1;
        justify-content: center;
    }
    
    .simple-code-editor {
        font-size: 12px;
        min-height: 250px;
    }
    
    .output-content {
        font-size: 12px;
        max-height: 200px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .exercise-editor-container {
        background: #1e1e1e;
    }
    
    .output-section {
        background: #252526;
        border-color: #3e3e42;
    }
    
    .output-header {
        background: #2d2d30;
        border-color: #3e3e42;
        color: #cccccc;
    }
    
    .output-content {
        color: #d4d4d4;
    }
    
    .output-placeholder {
        color: #858585;
    }
    
    .validation-success {
        background: rgba(16, 185, 129, 0.2);
        border-color: #10b981;
        color: #4ade80;
    }
    
    .validation-warning {
        background: rgba(255, 193, 7, 0.2);
        border-color: #ffc107;
        color: #fbbf24;
    }
    
    .validation-message {
        color: #e2e8f0;
    }
    
    .validation-similarity {
        color: #94a3b8;
    }
}

/* Scrollbar Styling */
.output-content::-webkit-scrollbar {
    width: 8px;
}

.output-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print Styles */
@media print {
    .editor-actions,
    .controls-section,
    .validation-result {
        display: none;
    }
    
    .simple-code-editor {
        border: 1px solid #000;
        background: #fff;
        color: #000;
    }
}

