:root {
    --primary-color: #00bcd4; 
    --accent-color: #ff9800; 
    --security-color: #e74c3c; 
    --marketing-color: #3498db; 
    --hacker-color: #2ecc71; 
    --text-color: #f0f0f5;
    --dark-bg: #1e1e3f;
    --card-bg: rgba(255, 255, 255, 0.1);
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-color);
    line-height: 1.6;

    background-image: 
        linear-gradient(270deg, rgba(30, 30, 63, 0.8), rgba(15, 15, 43, 0.8), rgba(30, 30, 63, 0.8), rgba(58, 58, 96, 0.8)), 
        url('https://eg2.top/images/cert.png'); 
        
    background-size: 400% 400%, cover;
    background-attachment: fixed;
    background-position: center center;
    
    animation: gradientAnimation 15s ease infinite; 
}


header {
    text-align: center;
    padding: 25px 30px; 
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.08); 
    border-radius: 15px;
    backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 2.2em; 
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4); 
}

/* 1. نظام الشبكة (Grid) - 4 أعمدة ثابتة */
.certificates-grid {
    /* التعديل الرئيسي: تثبيت 4 أعمدة متساوية */
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    width: 95%;
    max-width: 1250px; 
    padding: 20px;
    display: grid;
}

/* 2. تصميم بطاقة الشهادة (Card) - تصغير الحجم */
.cert-card {
    text-decoration: none;
    color: var(--text-color);
    background: var(--card-bg);
    padding: 18px; 
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid var(--primary-color);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    
    animation: fadeIn 0.8s ease-out both;
}

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


.cert-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-color); 
}

.cert-card h2 {
    font-size: 1.2em; 
    margin: 10px 0 8px;
    min-height: 48px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-card p {
    font-size: 0.85em; 
    opacity: 0.8;
    margin-bottom: 10px;
    min-height: 30px;
}

.icon-wrap {
    font-size: 2.5em; 
    color: var(--primary-color);
    margin-bottom: 8px;
}

.icon-wrap.security-icon {
    color: var(--security-color);
}
.icon-wrap.marketing-icon {
    color: var(--marketing-color);
}
.icon-wrap.hacker-icon {
    color: var(--hacker-color);
}

.view-link {
    display: block;
    margin-top: 5px;
    font-weight: 700;
    font-size: 0.9em;
    color: var(--accent-color);
}
.view-link i {
    margin-right: 5px;
}

/* 3. تصميم رابط التواصل السفلي */
.contact-footer {
    width: 95%;
    max-width: 550px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.whatsapp-contact {
    display: block;
    text-align: center;
    text-decoration: none;
    color: white;
    background-color: #25d366;
    padding: 12px;
    border-radius: 8px;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
}

.whatsapp-contact:hover {
    background-color: #1aae4d;
}

.whatsapp-contact i {
    margin-left: 8px;
}


footer {
    padding: 15px;
    margin-top: auto;
    font-size: 0.8em;
    opacity: 0.6;
    text-align: center;
}

/* 4. استجابة التصميم للموبايل */
/* 768px وأكبر: 4 أعمدة (كما هو محدد في .certificates-grid) */

@media (max-width: 992px) {
    /* على الأجهزة اللوحية الكبيرة، 3 أعمدة */
    .certificates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* على الأجهزة اللوحية الأصغر، عمودين */
    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px;
    }
}

@media (max-width: 500px) {
    /* على الهواتف المحمولة الصغيرة، عمود واحد */
    header h1 {
        font-size: 1.8em;
    }
    .certificates-grid {
        grid-template-columns: 1fr; 
        gap: 15px;
        padding: 10px;
    }
    .cert-card h2 {
        font-size: 1.3em;
    }
}