/* تنسيقات عامة للصفحة */
#downloads-page {
    padding: 100px 0 60px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
}

.back-button i {
    margin-right: 8px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* فلترة حديثة */
.modern-filter {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.filters {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 1rem;
}

.select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.filter-select {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.select-arrow {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    pointer-events: none;
    transition: all 0.3s ease;
}

.filter-select:focus + .select-arrow {
    color: var(--primary-color);
    transform: translateY(-50%) rotate(180deg);
}

/* قسم النتائج */
.results-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.results-info h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.4rem;
}

.results-count {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* حاوية الملفات */
.files-container {
    min-height: 200px;
}

/* عناصر الملفات */
.file-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 15px;
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-right: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
}

.file-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.file-badge {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 80px;
}

.grade-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.subject-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.file-desc {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 10px;
    line-height: 1.5;
}

.file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.file-author {
    color: var(--primary-color);
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.download-btn, .view-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.download-btn {
    background: var(--primary-color);
    color: white;
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.view-btn {
    background: var(--accent-color);
    color: white;
}

.view-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

/* رسالة عدم وجود ملفات */
.no-files-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
    display: none;
}

.no-files-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.no-files-message h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.no-files-message p {
    opacity: 0.7;
    font-size: 1rem;
}
/* رسالة الخطأ */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
}

.error-icon {
    font-size: 4rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error-message h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.error-message p {
    opacity: 0.7;
    font-size: 1rem;
}
/* في الشاشات المتوسطة (أقل من 992px) */
@media (max-width: 992px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .file-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .file-badge {
        flex-direction: row;
        min-width: auto;
    }
}

/* في الشاشات الصغيرة (أقل من 768px) */
@media (max-width: 768px) {
    .modern-filter {
        padding: 20px 15px;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-actions {
        width: 100%;
        justify-content: center;
    }
    
    .download-btn, .view-btn {
        flex: 1;
        justify-content: center;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* في الشاشات الصغيرة جداً (أقل من 480px) */
@media (max-width: 480px) {
    .file-actions {
        flex-direction: column;
    }
}