/* ====================================
   تصميم كاردات الأقسام الفاخرة
   ==================================== */

/* كاردات الأقسام - تصميم فاخر واحترافي */
.category-section .section-card {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #fdfeff 100%);
    border-radius: 20px;
    overflow: hidden;
    border: none;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-section .section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(192, 139, 45, 0.03) 0%, rgba(178, 43, 43, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    border-radius: 20px;
}

.category-section .section-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(145deg, #C08B2D, #B22B2B);
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.category-section .section-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(192, 139, 45, 0.15),
        0 15px 35px rgba(178, 43, 43, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.08);
}

.category-section .section-card:hover::before {
    opacity: 1;
}

.category-section .section-card:hover::after {
    opacity: 0.5;
}

/* Header الكارد - تصميم متدرج فاخر */
.category-section .section-card .bg-gradient-to-r {
    background: linear-gradient(135deg, #C08B2D 0%, #D4A843 40%, #C08B2D 70%, #B22B2B 100%);
    background-size: 200% 200%;
    padding: 2rem 1.75rem;
    position: relative;
    overflow: hidden;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.category-section .section-card .bg-gradient-to-r::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
}

.category-section .section-card:hover .bg-gradient-to-r::before {
    left: 100%;
}

.category-section .section-card .bg-gradient-to-r::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* عنوان القسم */
.category-section .section-card h3 {
    font-size: 1.375rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.625rem 0;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
    z-index: 1;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.category-section .section-card h3 i {
    font-size: 1.75rem;
    opacity: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.category-section .section-card:hover h3 i {
    transform: scale(1.15) rotate(8deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* عدد المقالات */
.category-section .section-card .text-white\/80 {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* محتوى الكارد */
.category-section .section-card > div:last-child {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: linear-gradient(to bottom, transparent 0%, rgba(248, 250, 252, 0.3) 100%);
}

/* المقالات داخل الكارد */
.category-section .section-card article {
    padding: 1.125rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 8px;
}

.category-section .section-card article:last-of-type {
    border-bottom: none;
}

.category-section .section-card article::before {
    content: '';
    position: absolute;
    right: -1.75rem;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #C08B2D 0%, #D4A843 50%, #B22B2B 100%);
    opacity: 0;
    transform: scaleY(0);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(192, 139, 45, 0.5);
}

.category-section .section-card article::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, 
        rgba(192, 139, 45, 0.03) 0%, 
        rgba(192, 139, 45, 0.01) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 8px;
}

.category-section .section-card article:hover {
    padding-right: 1rem;
    transform: translateX(-4px);
}

.category-section .section-card article:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.category-section .section-card article:hover::after {
    opacity: 1;
}

/* عناوين المقالات */
.category-section .section-card article h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.category-section .section-card article h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-section .section-card article:hover h4,
.category-section .section-card article:hover h4 a {
    color: #C08B2D;
}

/* معلومات المقال (التاريخ والمشاهدات) */
.category-section .section-card article .text-xs {
    font-size: 0.8125rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-section .section-card article .text-xs span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.category-section .section-card article .text-xs i {
    font-size: 0.875rem;
    color: #C08B2D;
}

/* رابط "عرض المزيد" الفاخر */
.category-section .section-card .pt-2 {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 2px solid transparent;
    background: linear-gradient(to right, #f1f5f9, transparent) bottom / 100% 1px no-repeat;
}

.category-section .section-card .pt-2 a {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #C08B2D 0%, #D4A843 50%, #B22B2B 100%);
    background-size: 200% 200%;
    box-shadow: 
        0 4px 15px rgba(192, 139, 45, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.category-section .section-card .pt-2 a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.category-section .section-card .pt-2 a:hover {
    background-position: 100% 50%;
    transform: translateX(-6px) scale(1.03);
    box-shadow: 
        0 8px 25px rgba(192, 139, 45, 0.4),
        0 4px 15px rgba(178, 43, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.category-section .section-card .pt-2 a:hover::before {
    left: 100%;
}

.category-section .section-card .pt-2 a i {
    font-size: 1.125rem;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.category-section .section-card .pt-2 a:hover i {
    transform: translateX(-6px) scale(1.1);
}

/* حالة فارغة (لا توجد أقسام) */
.category-section .sidebar-widget {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
}

.category-section .sidebar-widget i {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.category-section .sidebar-widget h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.75rem;
}

.category-section .sidebar-widget p {
    font-size: 1rem;
    color: #64748b;
    max-width: 400px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .category-section .grid {
        gap: 1.25rem;
    }
    
    .category-section .section-card h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .category-section .section-card {
        border-radius: 12px;
    }
    
    .category-section .section-card .bg-gradient-to-r {
        padding: 1.25rem 1rem;
    }
    
    .category-section .section-card h3 {
        font-size: 1rem;
    }
    
    .category-section .section-card h3 i {
        font-size: 1.25rem;
    }
    
    .category-section .section-card > div:last-child {
        padding: 1rem;
    }
    
    .category-section .section-card article h4 {
        font-size: 0.875rem;
    }
    
    .category-section .section-card:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 480px) {
    .category-section .section-card article .text-xs {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* تحسينات للأداء */
.category-section .section-card {
    will-change: transform;
}

.category-section .section-card:not(:hover) {
    will-change: auto;
}

/* تحسين للطباعة */
@media print {
    .category-section .section-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }
    
    .category-section .section-card .bg-gradient-to-r {
        background: #C08B2D !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

