/* ===== HEADER - مشترك بين جميع الصفحات - محسن ===== */
header {
    background-color: rgba(17, 17, 17, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
}

header.scrolled {
    background: rgba(13, 13, 13, 0.95) !important;
    backdrop-filter: blur(25px) !important;
    padding: 12px 40px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* التعديل هنا - جعل اللوجو دائري مع إطار ذهبي مثل الهيرو */
header img { 
    height: 55px;
    width: 55px;
    transition: all 0.3s ease;
    border-radius: 50%;
    border: 2px solid #d4af37;
    padding: 2px;
    background: #111;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    object-fit: cover;
}

header.scrolled img {
    height: 50px;
    width: 50px;
}

nav a {
    margin: 0 10px; /* ← ← ← صغرنا المسافة بين الروابط */
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 4px 12px; /* ← ← ← صغرنا البادنج أكثر */
    border-radius: 4px; /* ← ← ← صغرنا الزوايا أكثر */
    position: relative;
    font-size: 0.95rem; /* ← ← ← صغرنا الخط شوية */
}

nav a:hover { 
    color: #fff;
    background: rgba(212, 175, 55, 0.08); /* ← ← ← خففنا الخلفية */
    transform: translateY(-1px); /* ← ← ← خففنا الحركة */
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px; /* ← ← ← رفعنا الخط أكثر */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1.5px; /* ← ← ← صغرنا سمك الخط */
    background: #d4af37;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 70%; /* ← ← ← صغرنا عرض الخط */
}

/* ===== تنسيق الصفحة النشطة - إطار أنحف ===== */
nav a.active {
    color: #fff !important;
    background: rgba(212, 175, 55, 0.08) !important; /* ← ← ← خففنا الخلفية أكثر */
    border: 1px solid rgba(212, 175, 55, 0.25) !important; /* ← ← ← خففنا الإطار أكثر */
    position: relative;
    font-weight: 700;
    padding: 4px 12px; /* ← ← ← صغرنا البادنج أكثر */
}

/* خط ذهبي أنحف تحت النص بالظبط */
nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px; /* ← ← ← رفعنا الخط أكثر */
    left: 50%;
    transform: translateX(-50%);
    width: 60%; /* ← ← ← صغرنا عرض الخط أكثر */
    height: 1.5px; /* ← ← ← صغرنا سمك الخط */
    background: linear-gradient(90deg, #d4af37, #b8941f);
    border-radius: 1px;
    animation: activePulse 2s infinite;
}

@keyframes activePulse {
    0%, 100% { 
        opacity: 1; 
        transform: translateX(-50%) scaleX(1);
    }
    50% { 
        opacity: 0.6; /* ← ← ← خففنا التلاشي */
        transform: translateX(-50%) scaleX(0.85); /* ← ← ← صغرنا التقلص */
    }
}

/* تأثير هـوفر أنعم للصفحة النشطة */
nav a.active:hover {
    background: rgba(212, 175, 55, 0.12) !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
    transform: translateY(-1px); /* ← ← ← خففنا الحركة */
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15); /* ← ← ← خففنا الظل أكثر */
}

/* ===== أنيميشن التنقل بين الصفحات ===== */
@keyframes pageTransition {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تطبيق الأنيميشن على كل الصفحات */
body {
    animation: pageTransition 0.5s ease-out;
}

/* أنيميشن خاص للروابط عند النقر */
nav a {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

nav a:active {
    transform: scale(0.95); /* ← ← ← تأثير ضغط عند النقر */
    transition: transform 0.1s ease;
}

/* أنيميشن سلس للتحميل */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

/* ===== MEDIA QUERIES للهيدر - محسنة ===== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }
    
    header.scrolled {
        padding: 10px 20px;
    }
    
    nav {
        margin-top: 12px; /* ← ← ← صغرنا المسافة */
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px; /* ← ← ← صغرنا المسافات أكثر */
    }
    
    nav a {
        margin: 1px;
        font-size: 0.88rem; /* ← ← ← صغرنا الخط */
        padding: 3px 8px; /* ← ← ← صغرنا البادنج أكثر */
    }
    
    /* التعديل هنا أيضاً للموبايل */
    header img {
        height: 48px; /* ← ← ← صغرنا الشعار */
        width: 48px;
    }
    
    header.scrolled img {
        height: 43px;
        width: 43px;
    }
    
    /* تعديل الصفحة النشطة للموبايل */
    nav a.active {
        padding: 3px 10px; /* ← ← ← صغرنا البادنج أكثر */
        font-size: 0.92rem;
    }
    
    nav a.active::after {
        bottom: -4px;
        height: 1.2px; /* ← ← ← صغرنا الخط */
        width: 50%; /* ← ← ← صغرنا العرض */
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 12px; /* ← ← ← صغرنا البادنج */
    }
    
    nav {
        gap: 3px; /* ← ← ← صغرنا المسافات أكثر */
    }
    
    nav a {
        font-size: 0.82rem; /* ← ← ← صغرنا الخط */
        padding: 2px 6px; /* ← ← ← صغرنا البادنج أكثر */
        margin: 0.5px;
    }
    
    /* التعديل هنا أيضاً للشاشات الصغيرة */
    header img {
        height: 42px; /* ← ← ← صغرنا الشعار */
        width: 42px;
    }
    
    /* تعديل الصفحة النشطة للشاشات الصغيرة */
    nav a.active {
        padding: 2px 8px; /* ← ← ← صغرنا البادنج أكثر */
        font-size: 0.85rem;
    }
    
    nav a.active::after {
        bottom: -3px;
        width: 40%; /* ← ← ← صغرنا العرض أكثر */
        height: 1px; /* ← ← ← صغرنا الخط */
    }
}