/* ملف styles.css المحسن بشكل مودرن */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #3f51b5;
    --primary-dark: #303f9f;
    --primary-light: #c5cae9;
    --accent-color: #ff4081;
    --accent-dark: #f50057;
    --accent-light: #ff80ab;
    --text-color: #212121;
    --text-light: #757575;
    --background: #fafafa;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --special-cell: #ffca28;
    --elimination-cell: #ff5252;
    --correct-cell: #66bb6a;
    --wrong-cell: #ef5350;
    --grid-border: #e0e0e0;
    --transition: all 0.15s ease; /* تقليل مدة الانتقال أكثر */
    --border-radius: 12px;
    
    /* تحسينات الأداء */
    --transform-duration: 0.1s; /* تقليل المدة أكثر */
    --hover-duration: 0.05s; /* تقليل مدة التحويم */
}

body {
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--text-color);
    direction: rtl;
}

.container {
    max-width: 1280px;
    min-width: 280px;
    margin: 24px auto;
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 18px 28px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.header::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerShine 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes headerShine {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }
    50% {
        transform: translate(20px, 20px);
        opacity: 0.6;
    }
}

.header-title {
    font-size: 38px;
    font-weight: 700;
    text-align: center;
    width: 100%;
    padding: 8px 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 5;
    letter-spacing: 1px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تحسين تنسيق حاوية عناصر التحكم في الترويسة */
.header-controls {
    display: flex;
    gap: 14px;
    align-items: center;
    position: relative;
    z-index: 10;
}

.header-controls > * {
    position: relative;
    z-index: 10;
}

.settings-wrapper {
    position: relative;
    display: inline-block;
}
/* تنسيق زر التحكم بالصوت في الترويسة */
.header-controls .sound-control {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    backdrop-filter: blur(10px);
}

.header-controls .sound-control:hover {
    background-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.header-controls .sound-on {
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.header-controls .sound-off {
    color: #ff5252;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

.btn {
    padding: 12px 18px;
    border: none;
    border-radius: 50px;
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

#settingsMenuBtn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#settingsMenuBtn:hover {
    background-color: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.settings-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 10px;
    min-width: 180px;
    display: none;
}

.settings-menu.show {
    display: block;
}

.menu-btn {
    display: block;
    width: 100%;
    text-align: right;
    margin-bottom: 8px;
    background-color: transparent;
    color: var(--text-color);
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding-right: 20px;
}

/* --- Grid --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-bottom: 32px;
    perspective: 1000px;
}

.cell {
    aspect-ratio: 1;
    border: 2px solid var(--grid-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px; /* حجم خط مناسب ومقروء */
    font-weight: 700;
    cursor: pointer;
    background-color: var(--card-bg);
    position: relative;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03); /* تقليل الظلال */
    transition: transform var(--hover-duration) ease, 
                box-shadow var(--hover-duration) ease,
                border-color var(--hover-duration) ease; /* تحسين الانتقالات */
    overflow: hidden;
    will-change: transform; /* تحسين الأداء */
    contain: layout style paint; /* تحسين عملية الرسم */
}

.cell:hover {
    transform: translateY(-2px); /* تقليل المسافة */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.cell.special {
    background: linear-gradient(135deg, var(--special-cell), #ffd54f);
    color: #5d4037;
    font-size: 22px; /* تكبير خط خلايا التعجيز */
}

.cell.elimination {
    background: linear-gradient(135deg, var(--elimination-cell), #ff8a80);
    color: white;
    font-size: 22px; /* تكبير خط خلايا الطرد */
}

.cell.answered-correct {
    background: linear-gradient(135deg, var(--correct-cell), #a5d6a7);
    color: #1b5e20;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
}

.cell.answered-wrong {
    background: linear-gradient(135deg, var(--wrong-cell), #ef9a9a);
    color: #b71c1c;
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.cell.answered-wrong::after {
    content: "×";
    font-size: 42px;
    color: #b71c1c;
    position: absolute;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* تقليل الشفافية */
    z-index: 1000;
    /* إزالة backdrop-filter لتحسين الأداء */
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--card-bg);
    padding: 32px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* تقليل الظلال */
    animation: modalFadeIn 0.25s ease-out; /* تقليل مدة الرسومية */
    scroll-behavior: smooth;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 16px;
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* تنسيق حاوية عناصر التحكم في المودال */
.modal-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-right: 20px;
}

/* تنسيق زر التحكم بالصوت مع تحسينات إضافية */
.sound-control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sound-control:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sound-on {
    color: #66bb6a;
}

.sound-off {
    color: #ef5350;
}

/* تعديل على هيكل رأس المودال لتوزيع العناصر بشكل أفضل */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 16px;
}

.modal-title {
    flex: 1;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.close-modal {
    font-size: 32px;
    margin-right: 0;
    z-index: 1;
}

.close-modal:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

.timer {
    font-size: 56px;
    margin: 24px 0;
    color: var(--accent-color);
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-radius: 16px;
    padding: 16px;
    border: 2px solid #ffe082;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

.question-container {
    margin-bottom: 24px;
    background-color: rgba(197, 202, 233, 0.2);
    padding: 20px;
    border-radius: 12px;
}

.question-text {
    font-size: 28px;
    margin-bottom: 24px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-weight: 500;
}

/* تحديد حجم أقصى للصورة وضمان التمرير */
.question-image {
    max-height: 300px;
    max-width: 100%;
    object-fit: contain;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 20px;
    border: 2px solid var(--primary-light);
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    margin-bottom: 12px;
    text-align: center;
    transition: var(--transition);
    background-color: var(--card-bg);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.option:hover {
    background-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.option.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(63, 81, 181, 0.3);
}

.answer-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--primary-light);
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 20px;
    text-align: center;
    font-family: 'Tajawal', sans-serif;
    transition: var(--transition);
}

.answer-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.2);
    outline: none;
}

.answer-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 36px;
}

.answer-buttons .btn {
    padding: 16px 32px;
    font-size: 20px;
    min-width: 200px;
}

.correct-answer {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 12px;
    display: none;
    font-size: 22px;
    text-align: center;
    border: 2px solid #a5d6a7;
    color: #2e7d32;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.2);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Settings Panel */
.settings-panel {
    display: none;
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-top: 24px;
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.4s ease;
}

.settings-group {
    margin-bottom: 24px;
    padding: 16px;
    background-color: rgba(197, 202, 233, 0.1);
    border-radius: 12px;
    border: 1px solid var(--primary-light);
}

.settings-title {
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-dark);
    font-size: 18px;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.color-picker label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

/* Admin Panel */
.admin-panel {
    display: none;
    margin-top: 24px;
    animation: fadeIn 0.4s ease;
}

.admin-section {
    margin-bottom: 24px;
    padding: 16px;
    background-color: rgba(197, 202, 233, 0.1);
    border-radius: 12px;
    border: 1px solid var(--primary-light);
}

.admin-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.grid-size-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.grid-size {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.grid-size.active, .tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

.question-list {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0 8px;
}

.question-item {
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid var(--grid-border);
}

.question-item:hover {
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.question-item-elimination {
    border-right: 4px solid #ff5252;
    background-color: rgba(255, 82, 82, 0.05);
}

.question-item-content {
    flex: 1;
}

.question-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
}

.question-item-type {
    font-weight: bold;
    margin-right: 10px;
    color: #3f51b5;
}

.question-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.special-badge {
    display: inline-block;
    background-color: #ff9800;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    margin-right: 8px;
}

.elimination-badge {
    display: inline-block;
    background-color: #ff5252;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    margin-right: 8px;
}

.question-item-text {
    color: #555;
    font-size: 14px;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.question-item-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.edit-btn {
    background-color: #2196f3;
}

.delete-btn {
    background-color: #f44336;
}

.action-btn:hover {
    transform: scale(1.1);
}

html[dir="ltr"] .question-item-elimination {
    border-right: none;
    border-left: 4px solid #ff5252;
}

html[dir="ltr"] .question-item-type {
    margin-right: 0;
    margin-left: 10px;
}

html[dir="ltr"] .special-badge,
html[dir="ltr"] .elimination-badge {
    margin-right: 0;
    margin-left: 8px;
}

.add-question-form {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--grid-border);
    border-radius: 8px;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-left: 8px;
}

.tab-container {
    margin-bottom: 24px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--grid-border);
}

.tab-button {
    padding: 12px 20px;
    border: 1px solid var(--grid-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.tab-button:hover {
    background-color: rgba(197, 202, 233, 0.3);
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid var(--grid-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background-color: white;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        min-width: auto;
        padding: 16px;
        margin: 16px;
    }
    
    .header-title {
        font-size: 28px;
    }
    
    .grid-container {
        gap: 4px;
    }
    
    .cell {
        font-size: 16px;
        border-radius: 8px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .question-text {
        font-size: 20px;
    }
    
    .option {
        padding: 14px;
        font-size: 16px;
    }
    
    .timer {
        font-size: 40px;
    }
    /* تنسيقات محسنة لعرض نتيجة الإجابة */
    .answer-result {
        position: sticky;
        top: 10px;
        z-index: 100;
        margin: 0 auto 20px;
        width: 90%;
        max-width: 800px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        border-width: 3px;
        animation: pop-in 0.4s forwards;
        border-radius: 16px;
    }

    .result-text {
        font-size: 28px;
        font-weight: 700;
    }

    .result-text::before {
        font-family: 'Font Awesome 5 Free';
        font-size: 36px;
        font-weight: 900;
    }

    .result-text.correct {
        color: #2e7d32;
    }

    .result-text.correct::before {
        content: "\f058"; /* Font Awesome check-circle icon */
    }

    .result-text.wrong {
        color: #c62828;
    }

    .result-text.wrong::before {
        content: "\f057"; /* Font Awesome times-circle icon */
    }

    .correct-answer-text {
        font-size: 20px;
        font-weight: 500;
        background-color: rgba(255, 255, 255, 0.5);
        padding: 8px;
        border-radius: 8px;
    }

    /* تعديل خلفيات النتائج */
    .answer-result.correct-result {
        background: #e8f5e9;
        border-color: #66bb6a;
        color: #1b5e20;
    }

    .answer-result.wrong-result {
        background: #ffebee;
        border-color: #ef5350;
        color: #b71c1c;
    }

    /* تعديل أنماط moderatorContainer */
    #moderatorContainer .options-container {
        display: flex;
        gap: 20px;
        justify-content: center;
        margin-top: 20px;
    }

    #moderatorContainer .correct-btn {
        width: 180px;
        padding: 15px;
        font-size: 18px;
        text-align: center;
        transition: all 0.3s ease;
    }

    #moderatorContainer .correct-btn[data-value="true"] {
        border-color: #66bb6a;
    }

    #moderatorContainer .correct-btn[data-value="true"].selected {
        background-color: #66bb6a;
        color: white;
    }

    #moderatorContainer .correct-btn[data-value="false"] {
        border-color: #ef5350;
    }

    #moderatorContainer .correct-btn[data-value="false"].selected {
        background-color: #ef5350;
        color: white;
    }
    /* تأثير حركي لظهور النتيجة */
    @keyframes pop-in {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.8);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    /* تنسيق زر الإغلاق */
    #closeQuestionBtn {
        margin-top: 20px;
        padding: 12px 30px;
        background: rgba(255, 255, 255, 0.3);
        border: none;
        border-radius: 50px;
        cursor: pointer;
        font-size: 18px;
        font-weight: bold;
        transition: all 0.3s ease;
    }

    /* تنسيق زر عرض الإجابة الصحيحة في قسم تقييم المقدم */
    #showCorrectAnswerBtn {
        background: linear-gradient(135deg, #9c27b0, #7b1fa2);
        transition: all 0.3s ease;
        min-width: 200px;
        position: relative;
        overflow: hidden;
    }

    #showCorrectAnswerBtn:hover {
        background: linear-gradient(135deg, #7b1fa2, #9c27b0);
        transform: translateY(-2px);
        box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
    }

    #showCorrectAnswerBtn:active {
        transform: translateY(1px);
    }

    /* تنسيق حاوية الإجابة الصحيحة */
    #moderatorCorrectAnswer {
        background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
        border: 2px solid #a5d6a7;
        animation: fadeIn 0.5s ease;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    /* تأثير ظهور الإجابة */
    @keyframes showAnswer {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    #moderatorCorrectAnswer[style*="block"] {
        animation: showAnswer 0.3s ease;
    }

    /* تحسين ظهور أزرار التقييم عند تحديدها */
    #moderatorContainer .correct-btn[data-value="true"]:hover {
        background-color: rgba(102, 187, 106, 0.3);
    }

    #moderatorContainer .correct-btn[data-value="false"]:hover {
        background-color: rgba(239, 83, 80, 0.3);
    }
    .form-group-special {
        background-color: rgba(255, 202, 40, 0.05);
        border-radius: 8px;
        padding: 10px;
        border: 1px solid rgba(255, 202, 40, 0.2);
    }

    .form-group-special:hover {
        background-color: rgba(255, 202, 40, 0.1);
    }

    .filter-buttons {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 15px;
    }

    .filter-btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    .filter-btn.active {
        background-color: var(--primary-color);
        color: white;
    }

    /* شارات تمييز أنواع الأسئلة */
    .special-badge {
        display: inline-block;
        background-color: var(--special-cell);
        color: #5d4037;
        border-radius: 4px;
        padding: 2px 6px;
        font-size: 12px;
        margin-right: 8px;
        font-weight: bold;
    }
    /* *** أضف هذا الكود في نهاية الملف *** */
    /* أنماط لأزرار صح/خطأ */
    .truefalse-answer {
        padding: 10px 20px;
        background-color: rgba(255, 255, 255, 0.8);
        border: 2px solid #ddd;
        border-radius: 8px;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        transition: all 0.3s ease;
    }

    .truefalse-answer[data-value="true"] {
        color: #2e7d32;
        border-color: #2e7d32;
    }

    .truefalse-answer[data-value="false"] {
        color: #c62828;
        border-color: #c62828;
    }

    .truefalse-answer.selected[data-value="true"] {
        background-color: #66bb6a;
        color: white;
    }

    .truefalse-answer.selected[data-value="false"] {
        background-color: #ef5350;
        color: white;
    }
}

/* تصميم إشعار التراجع */
.undo-notification {
    position: fixed;
    top: 20px;
    right: 50%;
    transform: translateX(50%) translateY(-100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 32px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.undo-notification.show {
    transform: translateX(50%) translateY(0);
    opacity: 1;
}

.undo-notification i {
    font-size: 24px;
    animation: checkPulse 0.6s ease;
}

@keyframes checkPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* تصميم نافذة التأكيد المخصصة */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.custom-confirm-overlay.show {
    opacity: 1;
}

.custom-confirm-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-confirm-overlay.show .custom-confirm-box {
    transform: scale(1);
}

.custom-confirm-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-confirm-header i {
    font-size: 32px;
    animation: warningPulse 1.5s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.custom-confirm-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.custom-confirm-body {
    padding: 28px;
    color: #333;
}

.custom-confirm-body p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.custom-confirm-footer {
    padding: 20px 28px;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-confirm-footer button {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.custom-confirm-cancel {
    background: #e0e0e0;
    color: #555;
}

.custom-confirm-cancel:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-confirm-ok {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.custom-confirm-ok:hover {
    background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.custom-confirm-ok:active,
.custom-confirm-cancel:active {
    transform: translateY(0);
}
