* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Cairo', sans-serif;
}

body {
    background-color: #2c2c2c;
    color: white;
}


.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 60px;
    background: #a32121;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-box {
    background-color: white;
    padding: 5px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 208px; 
    height: 40px;
}

.logo-img {
    height: 28px;   
    width: auto;
    display: block;
    height: 100%; 
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 22px;
    color: white;
    cursor: pointer;
}

.navbar ul {
    display: flex;
    list-style: none;
    align-items: center;
}

.navbar ul li a {
    text-decoration: none;
    color: white;
    margin: 0 15px;
    font-size: 0.9rem;
}


.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #1a1a1a;
    top: 100%;
    left: 0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    padding: 10px;
    width: max-content;
    max-width: 80vw;
    flex-wrap: wrap;
    flex-direction: column;
    max-height: calc(5 * 44px + 20px);
    gap: 2px;
}

.dropdown:hover .dropdown-content {
    display: flex;
}

.dropdown-content a {
    color: white !important;
    padding: 10px 20px;
    display: block;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 140px;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: #a32121;
}


.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-lang {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    cursor: pointer;
}

.search-container {
    background: white;
    border-radius: 5px;
    padding: 5px 10px;
    display: flex;
}

.search-bar {
    border: none;
    outline: none;
    width: 150px;
}

a.username-profile {
    text-decoration: none;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

#logout-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

#logout-btn:hover {
    color: #f1c40f;
}

html[dir="rtl"] .dropdown-content {
    left: auto;
    right: 0;
}

html[dir="rtl"] .navbar ul {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nav-right {
    flex-direction: row-reverse;
}

html[dir="rtl"] .user-menu {
    flex-direction: row-reverse;
}

@media (max-width: 1024px) {
    .navbar {
        padding: 10px 25px;
    }
}

@media (max-width: 768px) {

    .navbar {
        padding: 10px 20px;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        width: 100%;
        display: none;
        background: #a32121;
        padding: 10px 0;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px;
        padding: 0 20px;
    }

    nav ul li a {
        font-size: 0.95rem;
    }

    .dropdown-content {
        position: static;
        background-color: #1a1a1a;
        box-shadow: none;
        margin-top: 5px;
        border-radius: 6px;
        padding: 8px;
        max-height: calc(5 * 42px + 16px);
        width: calc(100vw - 80px);
        max-width: none;
        overflow-x: auto;

    }

    .dropdown-content a {
        min-width: 120px;
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        padding: 10px 20px 0;
        gap: 10px;
        flex-direction: row !important;
    }

    .search-container {
        flex: 1;
        max-width: none;
    }

    .search-bar {
        width: 100%;
    }

    .user-menu {
        flex-direction: row !important;
    }

    .logo-box {
        width: 160px; 
        height: 32px;
    }

    html[dir="rtl"] .navbar ul {
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    html[dir="rtl"] nav ul li {
        width: 100%;
        text-align: right;
    }

    html[dir="rtl"] .nav-right {
        flex-direction: row !important;
    }

    html[dir="rtl"] .user-menu {
        flex-direction: row !important;
    }

    html[dir="rtl"] .dropdown-content {
        left: 0;
        right: auto;
    }

    html[dir="rtl"] .dropdown-content a {
        text-align: right;
    }
}

@media (max-width: 480px) {
.dropdown-content {
        max-height: calc(5 * 38px + 16px);
        width: calc(100vw - 60px);
    }

    .dropdown-content a {
        min-width: 100px;
        padding: 7px 10px;
        font-size: 0.78rem;
    }
}