/**
 * تحسينات إضافية لعرض الأقسام
 * Enhanced Categories Display CSS
 */

/* ===== تحسينات بطاقات الأقسام ===== */
.category-card {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* ===== صور الأقسام ===== */
.category-image-container {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: brightness(0.9);
}

.category-card:hover .category-image {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
}

.category-card:hover .category-overlay {
    opacity: 1;
}

.category-overlay i {
    font-size: 3.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ===== محتوى البطاقة ===== */
.category-card .card-body {
    padding: 25px 20px;
    position: relative;
}

.category-card .card-title {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.25rem;
    position: relative;
}

.category-card .card-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.category-card:hover .card-title::after {
    width: 60px;
}

.category-card .card-text {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 48px;
}

/* ===== الأزرار ===== */
.category-card .btn {
    border-radius: 30px;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.category-card .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.category-card .btn:hover::before {
    left: 100%;
}

.category-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ===== الأيقونات للأقسام بدون صور ===== */
.category-card .fa-3x {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* ===== تأثيرات متجاوبة ===== */
@media (max-width: 768px) {
    .category-image-container {
        height: 180px;
    }
    
    .category-card .card-body {
        padding: 20px 15px;
    }
    
    .category-card .card-title {
        font-size: 1.1rem;
    }
    
    .category-card .btn {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
}

/* ===== تأثيرات التحميل ===== */
.category-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== عنوان القسم ===== */
.categories-section-title {
    position: relative;
    text-align: center;
    margin-bottom: 50px;
    color: #2c3e50;
    font-weight: 700;
}

.categories-section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.categories-section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
    border-radius: 2px;
}

/* ===== تحسينات إضافية ===== */
.category-stats {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-stats {
    opacity: 1;
}

/* ===== تأثيرات الحركة المخفضة ===== */
@media (prefers-reduced-motion: reduce) {
    .category-card,
    .category-image,
    .category-overlay,
    .category-card .btn {
        transition: none;
        animation: none;
    }
    
    .category-card:hover {
        transform: none;
    }
    
    .category-overlay i {
        animation: none;
    }
}

/* ===== الوضع المظلم ===== */
@media (prefers-color-scheme: dark) {
    .category-card {
        background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }
    
    .category-card .card-title {
        color: #ecf0f1;
    }
    
    .category-card .card-text {
        color: #bdc3c7;
    }
}
