/* ===== إعدادات أساسية ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #E8F1FF 0%, #D6E8FF 50%, #C4DFFF 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===== العنوان الرئيسي ===== */
h2.text-center {
    color: #1C409E;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(28, 64, 158, 0.2);
    margin-bottom: 3rem;
    position: relative;
    text-align: center;
}

h2.text-center::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #2E5BBA, #4A73C7);
    border-radius: 2px;
}

/* ===== شبكة المقالات ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* ===== بطاقة المقال ===== */
.article-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 8px 25px rgba(28, 64, 158, 0.08);
    border: 1px solid rgba(28, 64, 158, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1C409E, #2E5BBA, #4A73C7, #658BD1);
    background-size: 400% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.article-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 15px 30px rgba(28, 64, 158, 0.15);
}

/* ===== شارة رقم المقال ===== */
.article-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #1C409E, #2E5BBA);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(28, 64, 158, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== عنوان المقال ===== */
.article-title {
    color: #1B3A94;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    margin-top: 1rem;
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: #2E5BBA;
}

/* ===== أزرار الإجراءات ===== */
.article-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.article-link {
    background: linear-gradient(45deg, #1C409E, #2E5BBA);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(28, 64, 158, 0.25);
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.article-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(28, 64, 158, 0.3);
    background: linear-gradient(45deg, #2E5BBA, #4A73C7);
    text-decoration: none;
    color: white;
}

.action-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.share-btn {
    background: linear-gradient(45deg, #4A73C7, #658BD1);
    color: white;
    box-shadow: 0 3px 12px rgba(74, 115, 199, 0.3);
}

.share-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 16px rgba(74, 115, 199, 0.4);
}

.copy-btn {
    background: linear-gradient(45deg, #658BD1, #81A5DB);
    color: white;
    box-shadow: 0 3px 12px rgba(101, 139, 209, 0.3);
}

.copy-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 5px 16px rgba(101, 139, 209, 0.4);
}

/* ===== تأثير الموج عند النقر ===== */
.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ===== رسالة عدم وجود مقالات ===== */
.no-articles {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    color: #5A7BC4;
    font-size: 1.2rem;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(28, 64, 158, 0.1);
    border: 1px solid rgba(28, 64, 158, 0.1);
}

/* ===== الأيقونات ===== */
.fas {
    margin-left: 0.5rem;
}

/* ===== الاستجابة للشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    h2.text-center {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .article-title {
        font-size: 1.2rem;
    }
    
    .article-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .article-link {
        width: 100%;
        padding: 1rem;
    }
    
    .action-btn {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    h2.text-center {
        font-size: 1.6rem;
    }
    
    .article-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .article-badge {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .article-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

/* ===== حركات إضافية للتفاعل ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeInUp 0.6s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== تأثيرات الانتقال السلسة ===== */
* {
    transition: all 0.3s ease;
}

/* ===== تحسينات للطباعة ===== */
@media print {
    body {
        background: white;
    }
    
    .article-card {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .action-btn {
        display: none;
    }
}