/* * ONSE Platform - Ultimate Professional Theme (Gold Edition)
 * Version: 4.0 Final
 * Features: Dark Mode, Glassmorphism, Circular Logo, Responsive Grid
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    /* --- ألوان النظام (Forced Dark Mode) --- */
    --bg-core: #020617;       /* أزرق ليلي عميق جداً (Slate 950) */
    --bg-surface: #0f172a;    /* سطح البطاقات (Slate 900) */
    
    --primary: #22c55e;       /* الأخضر الرسمي (Green 500) */
    --primary-hover: #16a34a; /* (Green 600) */
    --accent: #3b82f6;        /* أزرق ثانوي (Blue 500) */
    
    /* --- النصوص (High Contrast) --- */
    --text-white: #ffffff;    /* أبيض ناصع للعناوين */
    --text-gray: #e2e8f0;     /* رمادي فاتح جداً للنصوص */
    --text-muted: #94a3b8;    /* رمادي متوسط للهوامش */
    
    /* --- الزجاج (Glass Effect) --- */
    --glass-bg: rgba(15, 23, 42, 0.7); /* خلفية شبه شفافة */
    --glass-border: rgba(255, 255, 255, 0.1); /* حدود شفافة */
    
    /* --- الأبعاد والقياسات --- */
    --container: 1200px;
    --radius: 16px;           /* نصف قطر الحواف للبطاقات */
    --radius-circle: 50%;     /* للوجو والعناصر الدائرية */
    --header-height: 74px;
}

/* =========================================
   1. GLOBAL RESET & BASE STYLES
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-core) !important; /* إجبار الخلفية الداكنة */
    color: var(--text-white);
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    /* خلفية جمالية خفيفة جداً */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(34, 197, 94, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 25%);
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    width: min(var(--container), 100% - 2rem);
    margin-inline: auto;
}

/* =========================================
   2. TOPBAR (Sticky & Glass)
   ========================================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
    background: rgba(2, 6, 23, 0.85); /* شفافية عالية */
    backdrop-filter: blur(12px);      /* تغبيش الخلفية */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* --- الشعار (Logo) --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand__logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    /* ✅ اللوجو دائري حسب الطلب */
    border-radius: var(--radius-circle); 
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #fff; /* خلفية بيضاء لضمان وضوح الشعار */
    padding: 2px;
}

.brand__info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
}

.brand__slogan {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- القائمة (Navigation) --- */
.nav {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.nav__link {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nav__link:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.08);
}

.nav__link--active {
    background: var(--primary);
    color: #022c22; /* نص داكن على خلفية خضراء */
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

/* --- الأزرار العلوية --- */
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-toggle {
    display: none; /* مخفي في الحاسوب */
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

/* =========================================
   3. HERO SECTION (Centered)
   ========================================= */
.hero {
    position: relative;
    padding: 6rem 0 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
}

.hero__content {
    max-width: 900px;
    width: 100%;
    padding: 3.5rem 2rem;
    
    /* تصميم الزجاج */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.badge--glow {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary);
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
}

.hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-white);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__desc {
    font-size: 1.15rem;
    color: var(--text-gray);
    max-width: 650px;
    margin: 0 auto 2.5rem auto;
}

.hero__actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================
   4. BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn--lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn--sm { padding: 0.6rem 1.2rem; font-size: 0.9rem; }

.btn--primary {
    background: var(--primary);
    color: #022c22;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}
.btn--primary:hover {
    transform: translateY(-3px);
    background: var(--primary-hover);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

.btn--glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-color: var(--glass-border);
}
.btn--glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-white);
}

.btn--full {
    width: 100%;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    color: var(--primary);
    border: 1px solid var(--glass-border);
}
.btn--full:hover {
    background: var(--primary);
    color: #022c22;
}

/* =========================================
   5. SECTIONS & ACTIVITY GRID
   ========================================= */
.section { padding: 4rem 0; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--text-white);
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.link-arrow {
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}
.link-arrow:hover { gap: 10px; }

/* --- الشبكة (Grid) --- */
.cards-grid {
    display: grid;
    /* ✅ 3 أعمدة في الحاسوب */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* --- البطاقة (Card) --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* --- صورة الغلاف المتناسقة --- */
.card__media {
    position: relative;
    width: 100%;
    /* ✅ نسبة العرض للارتفاع ثابتة (16:9) */
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #000;
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ملء الإطار دون تشويه */
    transition: transform 0.6s ease;
}

.card:hover .card__img { transform: scale(1.1); }

.card__tag {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 2;
}
.tag--gold { background: rgba(234, 179, 8, 0.9); }
.tag--blue { background: rgba(59, 130, 246, 0.9); }

/* --- محتوى البطاقة --- */
.card__content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card__meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.meta-item { display: flex; align-items: center; gap: 6px; }

.card__title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.card__title a { transition: color 0.2s; }
.card__title a:hover { color: var(--primary); }

.mini-gallery {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.mini-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--glass-border);
    opacity: 0.8;
}

.card__footer {
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--glass-border);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--glass-bg);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}

/* =========================================
   6. ANIMATIONS & UTILITIES
   ========================================= */
.fade-in { animation: fadeIn 0.8s ease-out; }

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

/* =========================================
   7. RESPONSIVE DESIGN (Mobile)
   ========================================= */

/* شاشات التابلت (Tablet) */
@media (max-width: 1024px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* شاشات الهاتف (Mobile) */
@media (max-width: 900px) {
    /* Topbar adjustments */
    .brand__slogan { display: none; }
    .mobile-toggle { display: block; }

    /* القائمة المنسدلة للموبايل */
    .nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(2, 6, 23, 0.98); /* خلفية معتمة تقريباً */
        padding: 1.5rem;
        border-bottom: 1px solid var(--glass-border);
        gap: 10px;
        
        /* حالة الإخفاء */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    /* كلاس يضاف بـ JS لإظهار القائمة */
    .nav.nav--open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    
    .nav__link {
        width: 100%;
        text-align: center;
        padding: 12px;
        background: rgba(255,255,255,0.03);
    }

    /* Hero adjustments */
    .hero { padding: 4rem 0; min-height: auto; }
    .hero__content { padding: 2rem 1rem; }
    .h1 { font-size: 2.2rem; }
    
    /* Activity adjustments */
    .cards-grid { grid-template-columns: 1fr; } /* عمود واحد */
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .link-arrow { align-self: flex-end; }
}