/* Layout Styles (Header & Footer) */

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 10px 0;
    background: rgba(5, 5, 5, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 30px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    margin: 0 auto;
    /* Center the links */
    position: absolute;
    /* Absolute positioning to center relative to screen */
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    font-size: 1.05rem;
    font-weight: 700;
    position: relative;
    transition: all 0.3s ease;
}

/* Individual Link Colors */

/* 1. الرئيسية - أزرق سماوي */
.nav-links li:nth-child(1) a {
    color: #38bdf8;
    text-shadow: 0 0 5px rgba(56, 189, 248, 0.3);
}

/* 2. مباشر - بنفسجي */
.nav-links li:nth-child(2) a {
    color: #a78bfa;
    text-shadow: 0 0 5px rgba(167, 139, 250, 0.3);
}

/* 3. باقات - برتقالي وردي */
.nav-links li:nth-child(3) a {
    color: #f472b6;
    text-shadow: 0 0 5px rgba(244, 114, 182, 0.3);
}

/* 4. التحميل - أخضر زمردي */
.nav-links li:nth-child(4) a {
    color: #10b981;
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

/* 5. تواصل - أزرق مشرق */
.nav-links li:nth-child(5) a {
    color: #38bdf8;
    text-shadow: 0 0 5px rgba(56, 189, 248, 0.3);
}

/* 6. فحص السرعة - أخضر فسفوري */
.nav-links li:nth-child(6) a {
    color: #4ade80;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.3);
}

.nav-links a:hover,
.nav-links a.active {
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    transform: scale(1.1);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Footer */
footer {
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: linear-gradient(to top, #000 0%, transparent 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

footer p {
    background: linear-gradient(90deg, #22d3ee, #e879f9, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    text-shadow: 0 0 15px rgba(232, 121, 249, 0.3);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 100%);
    opacity: 0.5;
}

/* Responsive Navigation */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .logo img {
        height: 40px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        /* Removed display: none - mobile-enhancements.css handles visibility */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: #050505;
        /* Solid Black Background - No Transparency */
        padding: 20px 0;
        gap: 15px;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999;
        /* Force Top Layer */
        /* Removed backdrop-filter to prevent rendering issues */
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
        /* Removed animation to prevent freezing */
        transform: translateY(0);
    }

    /* Removed keyframes slideDown to save space and ensure no conflict */

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
        color: #ffffff !important;
        /* Force solid white color */
        background: transparent !important;
        /* Remove any background gradients */
        -webkit-text-fill-color: #ffffff !important;
        /* Override text clip */
        background-clip: border-box !important;
        -webkit-background-clip: border-box !important;
        text-shadow: none !important;
        /* Clean text */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255, 255, 255, 0.05) !important;
        color: #fbbf24 !important;
        -webkit-text-fill-color: #fbbf24 !important;
        transform: none !important;
        /* Prevent layout shifts */
        padding-right: 25px;
        /* Simple movement effect */
    }

    .nav-links a::after {
        display: none;
        /* Remove underline animation on mobile */
    }
}