/* أنماط المحتوى التفاعلي للدروس */

:root {
    --ice-bg: #f4f8fb;
    --ice-card: #ffffff;
    --ice-border: #dbe5ee;
    --ice-text: #1e293b;
    --ice-muted: #64748b;
    --ice-primary: #0ea5a4;
    --ice-primary-2: #0284c7;
    --ice-accent: #22c55e;
    --ice-shadow-sm: 0 6px 16px rgba(2, 132, 199, 0.08);
    --ice-shadow-md: 0 12px 28px rgba(2, 132, 199, 0.14);
}

.interactive-editor {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    color: var(--ice-text);
}

/* شريط الأدوات المحسن */
.editor-toolbar {
    border: 1px solid var(--ice-border);
    border-radius: 1rem;
    background:
        radial-gradient(1200px 320px at 15% -10%, rgba(14, 165, 164, 0.10) 0%, rgba(14, 165, 164, 0) 55%),
        radial-gradient(1200px 280px at 90% -20%, rgba(2, 132, 199, 0.10) 0%, rgba(2, 132, 199, 0) 55%),
        var(--ice-card);
    padding: 1.1rem;
    box-shadow: var(--ice-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.editor-toolbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.editor-toolbar h6,
.editor-toolbar small {
    color: var(--ice-text);
}

.editor-toolbar small.text-muted {
    color: var(--ice-muted) !important;
}

.editor-toolbar-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.editor-toolbar-tab {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.85);
    color: #475569;
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.editor-toolbar-tab:hover {
    border-color: rgba(14, 165, 164, 0.28);
    color: #0f766e;
    transform: translateY(-1px);
}

.editor-toolbar-tab.is-active {
    background: linear-gradient(135deg, rgba(14, 165, 164, 0.12), rgba(2, 132, 199, 0.12));
    border-color: rgba(14, 165, 164, 0.28);
    color: #0f766e;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
}

.editor-toolbar-panels {
    position: relative;
}

.editor-toolbar-panel {
    display: none;
}

.editor-toolbar-panel.is-active {
    display: block;
}

.editor-tools-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.editor-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 74px;
    padding: 0.7rem 0.55rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    background: #fff;
    color: #334155;
    font-weight: 700;
    font-size: 0.76rem;
    line-height: 1.2;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.editor-tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ice-shadow-sm);
}

.editor-tool-btn i {
    font-size: 1.15rem;
    line-height: 1;
}

.editor-tool-btn span {
    display: block;
    max-width: 100%;
}

.editor-tool-btn.tone-primary {
    color: #0369a1;
    border-color: #bae6fd;
    background: #f0f9ff;
}

.editor-tool-btn.tone-success {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.editor-tool-btn.tone-danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.editor-tool-btn.tone-info {
    color: #155e75;
    border-color: #a5f3fc;
    background: #ecfeff;
}

.editor-tool-btn.tone-warning {
    color: #92400e;
    border-color: #fde68a;
    background: #fffbeb;
}

.editor-tool-btn.tone-purple {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.editor-tool-btn.tone-neutral {
    color: #334155;
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* لوحة المحتوى المحسنة */
.content-canvas {
    min-height: 500px;
    border: 2px dashed #bfdbfe;
    border-radius: 1rem;
    padding: 2rem;
    background:
        linear-gradient(0deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.96)),
        repeating-linear-gradient(45deg, rgba(14, 165, 164, 0.03), rgba(14, 165, 164, 0.03) 16px, rgba(2, 132, 199, 0.03) 16px, rgba(2, 132, 199, 0.03) 32px);
    transition: all 0.3s ease;
    position: relative;
}

.content-canvas:hover {
    border-color: #38bdf8;
    background-color: #f8fcff;
}

.empty-state {
    padding: 4rem 2rem !important;
    animation: fadeIn 0.5s ease;
}

.empty-state i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* عناصر المحتوى المحسنة */
.content-element {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--ice-border);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    background: var(--ice-card);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.content-element:hover {
    box-shadow: var(--ice-shadow-md);
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.content-element .card-header {
    background: linear-gradient(120deg, #0ea5a4 0%, #0284c7 100%);
    color: white;
    padding: 1rem;
    border: none;
}

.element-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.element-info i {
    font-size: 1.25rem;
}

.element-title {
    font-weight: 600;
    color: white;
}

.element-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.content-element:hover .element-actions {
    opacity: 1;
}

.element-actions .btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.element-actions .btn:hover {
    transform: scale(1.06);
    background: rgba(255, 255, 255, 0.18);
}

/* أنماط الأسئلة التفاعلية المحسنة */
.interactive-question {
    background: linear-gradient(120deg, #0ea5a4 0%, #0284c7 100%);
    color: white;
    border-radius: 1rem;
    padding: 2rem;
    margin: 1rem 0;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.22);
}

.interactive-question h6 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.question-options .form-check {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.question-options .form-check:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(3px);
}

.question-options .form-check-input {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
}

.question-options .form-check-label {
    cursor: pointer;
    font-weight: 500;
    font-size: 1.05rem;
}

.question-explanation {
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
    border-left: 4px solid #48bb78;
}

/* أنماط معاينة العناصر */
.element-preview {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 0.5rem;
}

.element-preview img,
.element-preview video,
.element-preview audio {
    max-width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* أنماط الفواصل */
.separator-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e0, transparent);
    margin: 2rem 0;
}

.separator-space {
    background: transparent;
}

.separator-divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.separator-divider::before,
.separator-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 2px;
    background: linear-gradient(90deg, #cbd5e0, transparent);
}

.separator-divider::before {
    left: 0;
}

.separator-divider::after {
    right: 0;
}

.separator-divider i {
    background: white;
    padding: 0 1rem;
    color: #a0aec0;
    font-size: 1.5rem;
}

/* أنماط صفحة عرض الدرس التفاعلي */
.lesson-view .content-element {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.lesson-view .element-title {
    color: #0d6efd;
    font-weight: 600;
    margin-bottom: 1rem;
}

.lesson-view .interactive-question {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.lesson-view .question-feedback {
    margin-top: 1rem;
    font-weight: 500;
}

/* أنماط الوسائط */
.lesson-view .ratio {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.lesson-view audio {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* أنماط إضافية للأزرار */
.btn-outline-purple {
    color: #0ea5a4;
    border-color: #0ea5a4;
}

.btn-outline-purple:hover {
    background-color: #0ea5a4;
    border-color: #0ea5a4;
    color: white;
}

#draft-status {
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.file-upload-widget {
    border: 1px solid var(--ice-border);
    border-radius: 0.85rem;
    padding: 0.85rem;
    background: #fcfeff;
}

.file-upload-widget .nav-tabs {
    border-bottom-color: #dbeafe;
}

.file-upload-widget .nav-link {
    border-radius: 0.65rem 0.65rem 0 0;
    font-weight: 600;
    color: #475569;
}

.file-upload-widget .nav-link.active {
    color: #075985;
    background-color: #eff6ff;
    border-color: #bfdbfe #bfdbfe #eff6ff;
}

.upload-area {
    border: 2px dashed #bfdbfe;
    border-radius: 0.85rem;
    padding: 1rem;
    background: #f8fcff;
    transition: all 0.25s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #0ea5a4;
    background: #ecfeff;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 164, 0.15);
}

.upload-label {
    width: 100%;
    cursor: pointer;
    text-align: center;
    margin: 0;
}

.upload-preview {
    margin-top: 0.85rem;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: #ffffff;
}

.game-preview {
    background: linear-gradient(180deg, #f8fdff 0%, #eef9ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 0.85rem;
    padding: 0.9rem;
}

.game-icon-container {
    width: 52px;
    height: 52px;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

.modal-content {
    border-radius: 1rem;
    border: 1px solid #dbe5ee;
    box-shadow: var(--ice-shadow-md);
}

.modal-header {
    background: linear-gradient(120deg, #f0fdfa 0%, #eff6ff 100%);
    border-bottom: 1px solid #dbeafe;
}

.modal-title {
    color: #0f172a;
    font-weight: 700;
}

.form-control,
.form-select {
    border-radius: 0.7rem;
    border-color: #cbd5e1;
}

.form-control:focus,
.form-select:focus {
    border-color: #0ea5a4;
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 164, 0.18);
}

/* تحسينات responsiveness */
@media (max-width: 768px) {
    .editor-toolbar h6 {
        font-size: 0.9rem;
    }

    .editor-toolbar {
        border-radius: 0.8rem;
        padding: 0.8rem;
    }

    .editor-toolbar-head {
        flex-direction: column;
        align-items: flex-start;
    }

    #draft-status {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 992px) {
    .editor-tools-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .editor-toolbar-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }

    .editor-toolbar-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .editor-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .editor-tool-btn {
        min-height: 68px;
        padding: 0.65rem 0.45rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 520px) {
    .editor-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* أنماط التحميل والمعالجة */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0.75rem;
}

.processing-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* أنماط رسائل النجاح/الخطأ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

.element-saved {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(72, 187, 120, 0.5); }
}

.lesson-view .image-caption {
    text-align: center;
    font-style: italic;
    margin-top: 0.5rem;
}

/* أنماط التفاعل */
.content-element[data-type="interactive_question"] {
    border-left: 4px solid #0d6efd;
}

.content-element[data-type="image"] {
    border-left: 4px solid #198754;
}

.content-element[data-type="video"] {
    border-left: 4px solid #dc3545;
}

.content-element[data-type="audio"] {
    border-left: 4px solid #ffc107;
}

/* أنماط الاستجابة */
@media (max-width: 768px) {
    .content-canvas {
        padding: 1rem;
        min-height: 300px;
    }

    .content-element {
        margin-bottom: 1rem;
    }

    .interactive-question {
        padding: 1rem;
    }
}

/* أنماط الوضع المظلم (إذا كان مطلوباً) */
@media (prefers-color-scheme: dark) {
    .interactive-editor {
        color: #fff;
    }

    .editor-toolbar {
        background: #343a40;
        border-color: #495057;
    }

    .content-canvas {
        background: #212529;
        border-color: #495057;
    }

    .content-element {
        background: #343a40;
        border-color: #495057;
        color: #fff;
    }

    .element-title {
        color: #fff;
        border-color: #495057;
    }
}

/* أنماط الرسوم المتحركة */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-element {
    animation: fadeIn 0.3s ease-out;
}

/* أنماط الأزرار التفاعلية */
.btn-interactive {
    position: relative;
    overflow: hidden;
}

.btn-interactive::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn-interactive:hover::before {
    width: 300px;
    height: 300px;
}

/* أنماط شريط التقدم للدروس التفاعلية */
.interactive-progress {
    position: sticky;
    top: 20px;
    z-index: 100;
}

.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-step::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dee2e6;
    margin-right: 0.5rem;
    transition: background-color 0.3s ease;
}

.progress-step.active::before {
    background: #0d6efd;
}

.progress-step.completed::before {
    background: #198754;
}

.progress-step.completed::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    left: 5px;
}

/* ================================
   تنسيقات محرر الاختبارات
   ================================ */

/* بطاقة السؤال */
.question-card {
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateX(-5px);
}

.question-card .card {
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.question-card:hover .card {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.question-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

.question-card .badge {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
}

/* نموذج تحرير السؤال */
#questionModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#questionModal .form-label {
    color: #495057;
    margin-bottom: 0.5rem;
}

#questionModal .form-label i {
    opacity: 0.7;
}

/* خيارات الاختيار من متعدد */
.question-option {
    font-size: 0.95rem;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.input-group .form-check-input {
    cursor: pointer;
}

/* أزرار إدارة الأسئلة */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* إعدادات الاختبار */
#quiz-questions-container .text-muted {
    color: #6c757d !important;
}

#quiz-questions-container .fa-clipboard-question {
    opacity: 0.3;
}

/* تحسين Form Switches */
.form-check-switch .form-check-input {
    cursor: pointer;
    width: 2.5rem;
    height: 1.25rem;
}

.form-check-switch .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

/* تحسين Cards */
.card .card-header h6 {
    font-size: 1rem;
    font-weight: 600;
}

.card .card-body p {
    line-height: 1.6;
}

/* تحسين Badges في الأسئلة */
.question-card .text-success {
    color: #198754 !important;
}

.question-card .text-danger {
    color: #dc3545 !important;
}

/* تحسين Radio Buttons */
.form-check-input:checked[type="radio"] {
    background-color: #198754;
    border-color: #198754;
}

/* Animation للأسئلة */
@keyframes slideInQuestion {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-card {
    animation: slideInQuestion 0.3s ease;
}

/* تحسين Alert في الأسئلة */
.question-card .alert-info {
    background-color: #e7f3ff;
    border-color: #b3d7ff;
    color: #004085;
    font-size: 0.9rem;
}

/* تحسين Empty State */
#quiz-questions-container .fa-3x {
    font-size: 3rem;
}

/* Responsive للأسئلة */
@media (max-width: 768px) {
    .question-card .btn-group {
        flex-direction: column;
    }
    
    .question-card .btn-group .btn {
        width: 100%;
        border-radius: 0.25rem !important;
        margin-bottom: 0.25rem;
    }
}

/* ====================================
   نظام قوالب الألعاب التعليمية
   ==================================== */

/* بطاقات القوالب */
.template-selection {
    padding: 1rem 0;
}

.template-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.template-card:hover {
    border-color: #0d6efd;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.15);
}

.template-card:hover .template-select-btn {
    opacity: 1;
    transform: translateX(0);
}

.template-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.template-card:hover .template-icon {
    transform: scale(1.1) rotate(5deg);
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.template-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.5;
}

.template-select-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #0d6efd;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* رأس اللعبة */
.game-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.template-badge {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* عناصر اللعبة */
.game-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.game-item:hover {
    background: #e9ecef;
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-item-number {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.game-item-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.game-item-content .field-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-item-content .field-preview img {
    border-radius: 6px;
    border: 2px solid #dee2e6;
}

.game-item-content .field-text {
    font-size: 0.95rem;
    color: #495057;
}

.game-item-content .field-text strong {
    color: #2c3e50;
    margin-left: 0.25rem;
}

.game-item-content .field-category {
    display: flex;
    gap: 0.5rem;
}

.game-item-content .field-category .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.game-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.game-item-actions .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

/* Animations */
@keyframes slideInTemplate {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-card {
    animation: slideInTemplate 0.4s ease forwards;
}

.template-card:nth-child(1) { animation-delay: 0.05s; }
.template-card:nth-child(2) { animation-delay: 0.1s; }
.template-card:nth-child(3) { animation-delay: 0.15s; }
.template-card:nth-child(4) { animation-delay: 0.2s; }
.template-card:nth-child(5) { animation-delay: 0.25s; }
.template-card:nth-child(6) { animation-delay: 0.3s; }

.game-item {
    animation: slideInTemplate 0.3s ease;
}

/* Responsive للألعاب */
@media (max-width: 768px) {
    .template-card {
        padding: 1rem;
    }
    
    .template-icon {
        width: 60px;
        height: 60px;
    }
    
    .template-name {
        font-size: 1rem;
    }
    
    .template-description {
        font-size: 0.85rem;
    }
    
    .game-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .game-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .game-item-content {
        width: 100%;
    }
}

/* عرض بطاقة اللعبة */
.game-preview {
    padding: 0.5rem;
}

.game-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.game-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.game-stats .badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    font-weight: 500;
}

/* Responsive للأسئلة - تتمة */
@media (max-width: 768px) {
    .question-card .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    #questionModal .modal-dialog {
        margin: 0.5rem;
    }
}

/* ====================================
   نظام رفع الملفات
   ==================================== */

/* واجهة رفع الملفات */
.file-upload-widget {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload-widget:hover {
    border-color: #0d6efd;
    background: #f0f7ff;
}

/* منطقة الرفع */
.upload-area {
    position: relative;
    min-height: 200px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    padding: 2rem;
    margin: 0;
}

.upload-label:hover {
    border-color: #0d6efd;
    background: #f0f7ff;
}

.upload-label i {
    transition: transform 0.3s ease;
}

.upload-label:hover i {
    transform: scale(1.1);
}

/* شريط التقدم */
.upload-progress {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.upload-progress .progress {
    height: 25px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* المعاينة */
.upload-preview {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.preview-success img,
.preview-success video {
    max-height: 300px;
    margin: 0 auto;
    display: block;
}

.preview-success audio {
    width: 100%;
}

.preview-info {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* التبويبات */
.file-upload-widget .nav-tabs {
    background: white;
    border-radius: 8px 8px 0 0;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

.file-upload-widget .nav-tabs .nav-link {
    border: none;
    border-radius: 6px;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.file-upload-widget .nav-tabs .nav-link:hover {
    color: #0d6efd;
    background: #f0f7ff;
}

.file-upload-widget .nav-tabs .nav-link.active {
    color: white;
    background: #0d6efd;
}

.file-upload-widget .tab-content {
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* Drag and Drop */
.upload-area.dragover .upload-label,
.upload-area-small.dragover {
    border-color: #0d6efd;
    background: #e7f1ff;
    transform: scale(1.02);
}

/* نمط صغير لمنطقة الرفع - للألعاب */
.upload-area-small {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    cursor: pointer;
}

.upload-label-small {
    display: block;
    cursor: pointer;
    margin: 0;
}

.upload-area-small:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.upload-area-small .upload-progress {
    margin-top: 15px;
}

.upload-area-small .upload-preview {
    margin-top: 15px;
}

.upload-area-small .upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

/* تبويبات صغيرة */
.nav-tabs-sm .nav-link {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Animations */
@keyframes uploadSuccess {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-success {
    animation: uploadSuccess 0.4s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .file-upload-widget {
        padding: 1rem;
    }
    
    .upload-label {
        min-height: 150px;
        padding: 1rem;
    }
    
    .upload-label i {
        font-size: 2rem !important;
    }
    
    .file-upload-widget .nav-tabs {
        padding: 0.25rem;
    }
    
    .file-upload-widget .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .editor-toolbar .btn,
    .content-element,
    .question-card,
    .template-card {
        transition: none !important;
        animation: none !important;
    }
}