/* ===== النظام الهرمي للنماذج ===== */

/* التصفية المتقدمة */
.advanced-filters {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.advanced-filters h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-height: 45px;
}

.filter-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
    outline: none;
}

.filter-group select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 1rem;
}

.filter-btn, .reset-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.filter-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.reset-btn {
    background: #6c757d;
    color: white;
}

.reset-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* عرض النماذج الهرمي */
.exam-hierarchy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.hierarchy-item {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
}

.hierarchy-item.stage {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.hierarchy-item.level {
    background: linear-gradient(135deg, #00b894, #00a085);
}

.hierarchy-item.subject {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
}

/* مؤشرات التحميل والحالة */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-dark);
    font-weight: 500;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 1rem 0;
}

.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    margin: 2rem 0;
}

.no-results h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* الإشعارات */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    min-width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #00b894, #00a085);
}

.notification-error {
    background: linear-gradient(135deg, #e17055, #d63031);
}

.notification-info {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .filter-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-btn, .reset-btn {
        width: 100%;
    }
    
    .exam-hierarchy {
        flex-direction: column;
        gap: 5px;
    }
    
    .hierarchy-item {
        text-align: center;
        display: block;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* ===== بطاقات المواد مع الأيقونات ===== */

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.subject-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color, #3498db);
    transition: height 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--border-color, #3498db);
}

.subject-card:hover::before {
    height: 8px;
}

.subject-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

.subject-icon i {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

.subject-card:hover .subject-icon {
    transform: scale(1.1);
    background: rgba(52, 152, 219, 0.2);
}

.subject-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.exams-count {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.subject-description {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.view-subject-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 0.9rem;
}

.view-subject-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    text-decoration: none;
    color: white;
}

/* تحسينات للشاشات الصغيرة للبطاقات */
@media (max-width: 768px) {
    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .subject-card {
        padding: 1rem;
    }
    
    .subject-icon {
        width: 50px;
        height: 50px;
    }
    
    .subject-title {
        font-size: 1.1rem;
    }
}