/* --- إعدادات الألوان والهوية --- */
:root {
    --gold-primary: #b89551;
    --gold-hover: #d4ae6a;
    --dark-bg: #1a1a1a;
    --glass-white: rgba(255, 255, 255, 0.95);
    --section-bg: #fdfaf3;
    --white: #ffffff;
    --text-main: #2d2d2d;
    --text-muted: #777;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.05);
    --shadow-lg: 0 15px 40px rgba(184, 149, 81, 0.15);
}

/* --- التنسيق العام --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; }
body { background-color: var(--white); color: var(--text-main); scroll-behavior: smooth; line-height: 1.8; overflow-x: hidden; }

/* --- الهيدر (Navigation) --- */
header {
    background: var(--glass-white); padding: 12px 6%; 
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 25px rgba(0,0,0,0.08);
    position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(15px);
    border-bottom: 3px solid var(--gold-primary);
}
.logo-area { display: flex; align-items: center; gap: 15px; }
.logo-img { width: 60px; height: 60px; object-fit: contain; }
.logo-text h1 { color: var(--gold-primary); font-size: 1.4rem; font-weight: 800; }

nav ul { list-style: none; display: flex; gap: 10px; align-items: center; }
nav a { text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 0.9rem; transition: 0.3s; padding: 8px 12px; border-radius: 5px; }
nav a:hover { color: var(--gold-primary); background: rgba(184, 149, 81, 0.05); }

.header-btns { display: flex; gap: 15px; align-items: center; }
.btn-donate { background: #27ae60; color: white !important; padding: 10px 22px; border-radius: 8px; display: flex; align-items: center; gap: 8px; transition: 0.3s; font-weight: 700; text-decoration: none; }
.btn-donate:hover { background: #219150; transform: scale(1.05); }
.btn-login { border: 2px solid var(--gold-primary); color: var(--gold-primary); padding: 8px 22px; border-radius: 8px; font-weight: 700; text-decoration: none; transition: 0.3s; }
.btn-login:hover { background: var(--gold-primary); color: white; }

/* --- السلايدر --- */
.slider-wrapper { width: 100%; height: 550px; position: relative; overflow: hidden; background: #000; }
.slide { position: absolute; inset: 0; opacity: 0; transition: 1.5s ease-in-out; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.slide.active { opacity: 1; }
.slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3)); }
.slide-content { position: relative; z-index: 5; color: white; text-align: center; max-width: 900px; padding: 0 20px; transform: translateY(30px); transition: 1s 0.5s; opacity: 0; }
.slide.active .slide-content { transform: translateY(0); opacity: 1; }
.slide-content h2 { font-size: 3.5rem; color: var(--gold-primary); margin-bottom: 20px; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); font-weight: 800; }

/* --- الأقسام العامة --- */
section { padding: 100px 8%; }
.section-header { text-align: center; margin-bottom: 60px; padding: 0 10%; }
.section-header h2 { color: var(--gold-primary); font-size: 2.3rem; position: relative; display: inline-block; padding-bottom: 18px; font-weight: 800; }
.section-header h2::after { content: ''; width: 60px; height: 4px; background: var(--gold-primary); position: absolute; bottom: 0; right: 50%; transform: translateX(50%); border-radius: 2px; }

/* --- البطاقات (Cards) --- */
.about-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.about-box { padding: 50px; border-radius: 15px; background: var(--gold-primary); color: white; position: relative; overflow: hidden; transition: 0.4s; }
.about-box h3 { font-size: 1.8rem; margin-bottom: 20px; border-right: 5px solid var(--white); padding-right: 15px; }

.achievements-grid, .grid-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.achieve-card, .service-card { background: white; padding: 45px 35px; border-radius: 20px; box-shadow: var(--shadow-soft); border-bottom: 4px solid transparent; transition: 0.3s; text-align: center; }
.achieve-card:hover, .service-card:hover { border-bottom-color: var(--gold-primary); transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.achieve-card i, .service-card i { font-size: 3rem; color: var(--gold-primary); margin-bottom: 25px; display: block; }

/* --- معرض المرئيات --- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 30px; }
.video-item { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16/9; background: #000; box-shadow: var(--shadow-soft); cursor: pointer; }
.video-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: 0.6s; }
.play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 4rem; opacity: 0.9; }
.video-title { position: absolute; bottom: 25px; right: 25px; color: white; font-weight: 800; font-size: 1.2rem; }

/* --- الفوتر --- */
footer { background: var(--dark-bg); color: white; padding: 80px 8% 40px; text-align: center; border-top: 5px solid var(--gold-primary); }
.social-links { margin-bottom: 40px; display: flex; justify-content: center; gap: 25px; }
.social-links a { color: rgba(255,255,255,0.6); font-size: 1.8rem; transition: 0.4s; }
.social-links a:hover { color: var(--gold-primary); transform: translateY(-5px); }

/* --- التجاوب --- */
@media (max-width: 992px) {
    header { flex-direction: column; padding: 20px; gap: 20px; }
    nav ul { flex-wrap: wrap; justify-content: center; }
    .slide-content h2 { font-size: 2.2rem; }
}
/* --- 1. تأثيرات الظهور الناعم (Scroll Animation) --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 2. الوضع الليلي التلقائي (Dark Mode) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #121212;
        --section-bg: #1a1a1a;
        --text-main: #e0e0e0;
        --glass-white: rgba(20, 20, 20, 0.95);
    }
    .card, .achieve-card, .service-card, .about-box {
        background: #252525 !important;
        border: 1px solid #333;
    }
    header { background: #121212; }
}

/* --- 3. زر الواتساب العائم --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #25d366;
    color: white;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000; transition: 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); color: white; }

/* --- تنسيق البوب أب --- */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* مخفي افتراضياً */
    align-items: center; justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: white;
    width: 90%; max-width: 500px;
    padding: 40px;
    border-radius: 20px;
    position: relative;
    text-align: center;
    border-top: 6px solid var(--gold-primary);
    animation: popupSlide 0.4s ease-out;
}

@keyframes popupSlide {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.event-box {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.btn-read-more {
    display: inline-block;
    margin-top: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}
.btn-read-more:hover {
    text-decoration: underline;
}
.event-box:hover {
    transform: translateY(-5px);
}

.event-box img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.event-date {
    color: #777;
    font-size: 14px;
    margin-top: 10px;
}

.close-popup {
    position: absolute;
    top: 15px; left: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: 0.3s;
}
.close-popup:hover { color: var(--gold-primary); }

.popup-header i {
    font-size: 3rem;
    color: var(--gold-primary);
    margin-bottom: 15px;
}
.popup-header h3 { margin-bottom: 15px; font-weight: 800; color: var(--dark-bg); }
.popup-body p { font-size: 1.1rem; line-height: 1.6; color: #555; margin-bottom: 25px; }

.popup-footer .btn-donate {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
}
/* --- الكلاس الأساسي للزر الذهبي --- */
.btn-gold {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #c5a059 0%, #e2c285 100%); /* تدرج ذهبي فخم */
    color: #ffffff !important; /* لون النص أبيض */
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50px; /* حواف دائرية لإعطاء مظهر عصري */
    border: none;
    transition: all 0.3s ease; /* سلاسة في تغيير الألوان */
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3); /* ظل ذهبي خفيف */
    cursor: pointer;
    text-align: center;
}

/* --- تأثير عند مرور الماوس (Hover) --- */
.btn-gold:hover {
    background: linear-gradient(135deg, #b38f48 0%, #c5a059 100%); /* تغميق اللون قليلاً */
    transform: translateY(-3px); /* رفعة بسيطة للأعلى */
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.5); /* زيادة قوة الظل */
    color: #fff;
}

/* --- تأثير عند الضغط --- */
.btn-gold:active {
    transform: translateY(-1px);
}
.events-section {
    display: -webkit-box;      /* Safari & iOS */
    display: -ms-flexbox;      /* IE 10 */
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.event-box {
    /* إضافة عرض مرن للسفاري */
    -webkit-box-flex: 1;
    -ms-flex: 1 1 300px;
    flex: 1 1 300px; 
    margin: 10px; /* ضمان تباعد حتى لو لم يعمل الـ gap */
    max-width: 350px;
}
html {
    -webkit-text-size-adjust: 100%; /* منع سفاري من تكبير الخط تلقائياً */
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}
.event-box img {
    width: 100%;
    height: 200px;
    -o-object-fit: cover;
    object-fit: cover; /* لضمان عدم تمدد الصورة */
    border-radius: 12px 12px 0 0;
}
.btn-gold {
    background: #c5a059; /* لون احتياطي */
    background: -webkit-linear-gradient(135deg, #c5a059 0%, #e2c285 100%);
    background: linear-gradient(135deg, #c5a059 0%, #e2c285 100%);
    
    /* منع سفاري من تغيير شكل الزر الافتراضي */
    -webkit-appearance: none;
    appearance: none;
    
    -webkit-box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
}