/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    transition: transform 0.1s ease;
    box-shadow: 0 0 20px var(--neon-cyan);
}

.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--neon-pink);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    opacity: 0.7;
    animation: cursorPulse 2s infinite ease-in-out;
}

@keyframes cursorPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.5); opacity: 0.3; }
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

/* تطبيق التصغير على عناصر الهيدر فقط في الصفحة الرئيسية */
body[data-page="home"] header .header-content {
    transform: scale(0.8);
    transform-origin: top center;
}

body[data-page="home"] header {
    min-height: calc(80px * 0.8);
}

header .container {
    max-width: 100%;
    padding: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    min-height: 80px;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-family: 'Orbitron', monospace;
    font-size: 2.0rem; 
    font-weight: 900;
    background: var(--holographic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    display: flex;
    align-items: center;
    height: 70px;
    max-height: 70px;
    overflow: hidden;
}

.privacy-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.privacy-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

.header-logo-image {
    max-height: 65px !important;
    max-width: 150px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.header-logo-image:hover {
    opacity: 0.8;
}

/* Navigation Container */
.nav-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Visible Items (Always Shown) */
.visible-items {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.start-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.8rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    white-space: nowrap;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
}

/* Language Switcher */
.language-switcher { 
    position: relative; 
}

.lang-btn { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    padding: 0.8rem 1.2rem; 
    background: var(--glass-bg); 
    border: 1px solid var(--glass-border); 
    border-radius: 25px; 
    color: white; 
    font-size: 1rem; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.lang-menu { 
    position: absolute; 
    top: 100%; 
    right: 0; 
    background: rgba(10, 10, 15, 0.95); 
    backdrop-filter: blur(30px); 
    border: 1px solid var(--neon-cyan); 
    border-radius: 15px; 
    min-width: 180px; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px); 
    transition: all 0.3s ease; 
    list-style: none; 
    padding: 0.5rem 0; 
    margin: 0; 
    z-index: 1001; 
}

.lang-menu.show { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(5px); 
}

.lang-menu button { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    width: 100%; 
    padding: 0.8rem 1rem; 
    background: transparent; 
    border: none; 
    color: white; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-size: 0.9rem;
}

.lang-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hamburger Button */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.hamburger-btn span {
    width: 24px;
    height: 2.5px;
    background: white;
    margin: 2.5px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hamburger Menu - القائمة الجانبية المنسدلة */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    max-width: 85vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--neon-cyan);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
}

.hamburger-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Backdrop/Overlay للخلفية */
.hamburger-menu::before {
    display: none !important; /* تم تعديل هذا السطر لإلغاء الظل */
    content: '';
    position: fixed;
    top: 0;
    right: 350px;
    width: calc(100vw - 350px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: -1;
}

.hamburger-menu-content {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    height: 100%;
    overflow-y: auto;
    gap: 0.8rem;
}

/* Scrollbar styling */
.hamburger-menu-content::-webkit-scrollbar {
    width: 6px;
}

.hamburger-menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.hamburger-menu-content::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 3px;
}

.menu-back-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    border-radius: 15px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.menu-back-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateX(-5px);
}

.menu-back-btn span:first-child {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.menu-back-btn:hover span:first-child {
    transform: translateX(-3px);
}

.hamburger-menu-content a {
    color: white;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hamburger-menu-content a:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: var(--neon-cyan);
    transform: translateX(-5px);
    box-shadow: -5px 5px 20px rgba(0, 255, 255, 0.2);
}

/* RTL/LTR Support */
html[dir="ltr"] .lang-menu { 
    left: 0; 
    right: auto; 
}

@media (max-width: 768px) {
    .hamburger-menu {
        width: 300px;
    }
    
    .hamburger-menu::before {
        right: 300px;
    }
    
    .header-content { 
        padding: 0.4rem 0.6rem; 
        min-height: 55px;
    }
    
    .logo-section {
        gap: 0.5rem;
    }
    
    .logo { 
        font-size: 1.4rem;
        height: 45px;
        max-height: 45px;
    }

    .header-logo-image {
        max-height: 40px !important;
        max-width: 100px !important;
    }

    .privacy-link {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        border-radius: 12px;
    }

    .visible-items {
        gap: 0.4rem;
    }
    
    .start-btn {
        font-size: 0.75rem; 
        padding: 0.45rem 0.9rem;
        border-radius: 15px;
    }
    
    .lang-btn {
        padding: 0.45rem 0.7rem; 
        font-size: 0.75rem;
        border-radius: 15px;
    }
    
    .hamburger-btn {
        width: 32px; 
        height: 32px;
        padding: 0.25rem;
    }
    
    .hamburger-btn span {
        width: 18px;
        height: 1.5px;
        margin: 1.5px 0;
    }
    
    .hamburger-menu-content {
        padding: 1.5rem 1rem;
    }
    
    .hamburger-menu-content a {
        font-size: 0.95rem;
        padding: 0.9rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .hamburger-menu {
        width: 280px;
    }
    
    .hamburger-menu::before {
        right: 280px;
    }
    
    .header-content { 
        padding: 0.3rem 0.5rem;
        min-height: 48px;
    }
    
    .logo-section {
        gap: 0.4rem;
    }
    
    .logo { 
        font-size: 1.2rem;
        height: 38px;
        max-height: 38px;
    }

    .header-logo-image {
        max-height: 35px !important;
        max-width: 90px !important;
    }

    .privacy-link {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
        border-radius: 10px;
    }
    
    .visible-items {
        gap: 0.3rem;
    }
    
    .start-btn {
        font-size: 0.7rem; 
        padding: 0.35rem 0.7rem;
        border-radius: 12px;
    }
    
    .lang-btn {
        padding: 0.35rem 0.6rem; 
        font-size: 0.7rem;
        border-radius: 12px;
    }

    .hamburger-btn {
        width: 28px; 
        height: 28px;
        padding: 0.2rem;
    }
    
    .hamburger-btn span {
        width: 16px;
        height: 1.5px;
        margin: 1.5px 0;
    }
    
    .hamburger-menu-content {
        padding: 1.2rem 0.8rem;
    }
    
    .hamburger-menu-content a {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }
    
    .menu-back-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }
}

/* Custom RTL/LTR direction for header as per user request */
html[dir="rtl"] .header-content {
    direction: ltr;
}

html[dir="ltr"] .header-content {
    direction: rtl;
}