:root {
    --dot-size: 50px;
    --dot-color: #ff3131;
    --menu-bg: var(--bg-color);
    --menu-text-color: var(--text-color);
    --header-height: 80px;
}

.header-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

/* Remove theme filters as requested */
[data-theme="light"] .header-logo-img,
[data-theme="dark"] .header-logo-img {
    filter: none !important;
}

/* Header Container adjustments to accommodate absolute menu */
header {
    position: relative;
    z-index: 100;
}

header .container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* The Toggle Button */
.menu-dot {
    width: var(--dot-size);
    height: var(--dot-size);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002; /* Above menu */
    padding: 0;
    outline: none;
    position: relative;
}

.dot {
    display: block;
    width: 18px;
    height: 18px;
    background-color: #ff3131 !important; /* Force Red Color */
    border-radius: 50%;
    /* Remove transition to avoid conflicts with GSAP */
    position: relative;
    z-index: 2;
    animation: dotPulse 2s infinite;
}

.menu-dot.is-open .dot {
    animation-play-state: paused;
    pointer-events: none;
}

/* Ensure ripple is also red */
.menu-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ff3131 !important;
    border-radius: 50%;
    opacity: 0.4;
    z-index: 1;
    animation: dotRipple 2s infinite;
    transition: opacity 0.3s ease;
}

/* Hide ripple when open */
.menu-dot.is-open::after {
    opacity: 0;
    animation: none;
    pointer-events: none;
    display: none;
}

/* Show Menu when open */
.header-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.header-menu.is-open a {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1023px) {
    .header-menu.is-open {
        transform: translateY(0);
    }
}

@keyframes dotPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0px var(--dot-color);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 15px var(--dot-color);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0px var(--dot-color);
    }
}

@keyframes dotRipple {
    0% {
        transform: scale(0.4);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Hover Effect - Only when not open */
.menu-dot:not(.is-open):hover .dot {
    box-shadow: 0 0 20px var(--dot-color);
    transform: scale(1.3);
    animation-play-state: paused;
}

.menu-dot:not(.is-open):hover::after {
    animation-play-state: paused;
}

/* The Menu Overlay */
.header-menu {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    background: var(--menu-bg);
    /* default for Arabic (logo يسار، زر القائمة يمين) */
    right: 0;
    left: auto;
    padding: 0 60px 0 30px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    z-index: 1001;
    border-radius: 40px 0 0 40px;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.header-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Align menu with logo side in English (logo يمين، زر القائمة يسار) */
.lang-en .header-menu {
    right: auto;
    left: 0;
    padding: 0 30px 0 60px;
    border-radius: 0 40px 40px 0;
}

/* Menu Links */
.header-menu a {
    color: var(--menu-text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 15px;
    opacity: 0; /* For stagger animation */
    transform: translateY(10px);
    transition: color 0.3s;
    white-space: nowrap;
}

.header-menu a:hover {
    color: var(--dot-color);
}

.lang-switch {
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    border-radius: 20px;
}

.lang-switch:hover {
    border-color: var(--dot-color);
    background: rgba(255,0,0,0.1);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--menu-text-color);
    font-size: 1.5rem;
    cursor: pointer;
    margin: 0 15px;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--primary-color);
}

/* Mobile Styles */
@media (max-width: 1023px) {
    .header-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100vh; /* Full screen on mobile */
        flex-direction: column;
        justify-content: center;
        padding: 0;
        border-radius: 0;
        background: var(--menu-bg);
        transform: translateY(-100%); /* Start from top */
    }

        /* نفس السلوك على الموبايل للغتين (قائمة تغطي الشاشة كاملة) */

    .header-menu a {
        margin: 15px 0;
        font-size: 1.5rem;
    }
}
