/* Header Styles */
.main-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo img {
    height: 50px;
}

.main-nav ul {
    display: flex;
}

.main-nav a,
.newadd-icon a {
    color: var(--middleColor);
    font-weight: 500;
    padding: 0.5rem;
    border-radius: var(--radius0);
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--helperColor);
    color: var(--white);
}

.newadd-icon a {
    background: var(--lightHelper);
}

.newadd-icon a:hover {
    background: var(--helperColor);
    color: var(--white);
}

/* Dropdown Menu */
.main-nav .dropdown {
    position: relative;
}

.main-nav .dropdown-toggle {
    /*display: flex;*/
    align-items: center;
    gap: 0.5rem;
}

/* Country Selector Styles */
.country-selector {
    background: var(--helperColor);
    color: var(--white) !important;
    /* border-radius: var(--radius1) !important; */
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.country-selector:hover {
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.country-selector .flag-icon {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.country-selector .country-text {
    font-weight: 600;
}

/* Country Dropdown Menu */
.country-dropdown {
    min-width: 220px;
    padding: 0.75rem 0;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.country-link {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem !important;
    color: var(--lightHelper) !important;
    background: transparent !important;
    border-radius: 0 !important;
    transition: all 0.3s ease;
    /* border-left: 3px solid transparent; */
}

.country-link:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: var(--helperColor) !important;
    border-left-color: var(--helperColor);
    transform: translateX(-3px);
}

.country-link .flag {
    font-size: 1.5rem;
    width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.country-link .flag img {
    height: 100%;
}

.country-link .country-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.main-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0.5rem 0;
    list-style: none;
    display: block;
}

.main-nav .dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav .dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--middleColor);
    background: transparent;
    border-radius: 0;
    transition: background 0.3s ease;
}

.main-nav .dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--helperColor);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-icon,
.messages-icon {
    position: relative;
}

.notification-icon a,
.messages-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f0eff5;
    border-radius: 50%;
    color: var(--helperColor);
    text-decoration: none;
    transition: all 0.3s ease;
}

.notification-icon a:hover,
.messages-icon a:hover {
    background: var(--helperColor);
    color: var(--white);
}

.notification-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #dc3545;
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.user-btn:hover {
    background: #f0eff5;
}

.user-btn img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--helperColor);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--middleColor);
    text-decoration: none;
    transition: background 0.3s ease;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 0;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.login-btn,
.post-ad-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn {
    background: transparent;
    color: var(--helperColor);
    border: 2px solid var(--helperColor);
}

.login-btn:hover {
    background: var(--helperColor);
    color: var(--white);
}

.post-ad-btn {
    background: #28a745;
    color: var(--white);
    border: 2px solid #28a745;
}

.post-ad-btn:hover {
    background: #218838;
    border-color: #218838;
}

/* Country Switcher Styles */
.country-switcher {
    position: relative;
    margin-left: 1rem;
}

.country-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0eff5;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: background 0.3s ease;
    color: var(--middleColor);
    font-weight: 500;
    font-size: 0.9rem;
}

.country-switcher-btn:hover {
    background: #e9ecef;
}

.country-switcher-btn .flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.country-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 0.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.country-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.country-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--middleColor);
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.country-dropdown-item:hover {
    background: #f8f9fa;
}

.country-dropdown-item .flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.country-dropdown-item.active {
    background: #e3f2fd;
    color: var(--helperColor);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 3px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--middleColor);
    transition: all 0.3s ease;
}


.mobile-nav.active ul {
    list-style: none;
    padding: 1rem 0;
    position: fixed;
    right: 0;
    height: auto;
    z-index: 99;
    background: var(--helperColor);
    width: 100%;
    box-shadow: 0 11px 10px rgb(0 0 0 / 20%);
}

.mobile-nav.active a {
    display: block;
    padding: 0.75rem 1rem;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid #004081;
}

.mobile-nav.active a:hover {
    background: #001e69;
    ;
}

/* Mobile Dropdown */
.mobile-dropdown {
    position: relative;
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Mobile Country Styles */
.mobile-country-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white) !important;
    border-radius: 8px;
    margin: 0.25rem;
    padding: 0.75rem 1rem !important;
}

.mobile-country-toggle .mobile-flag-icon {
    font-size: 1.2rem;
}

.mobile-country-menu {
    background: #f8f9fa !important;
    border-radius: 8px;
    margin: 0.25rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.mobile-country-link {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem !important;
    border-radius: 6px !important;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.mobile-country-link:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    color: var(--helperColor) !important;
}

.mobile-country-link .mobile-flag {
    font-size: 1.3rem;
    width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-dropdown-menu {
    display: none;
    background: #e9ecef;
    padding-right: 1rem;
}

.mobile-dropdown.active .mobile-dropdown-menu {
    display: block;
}

.mobile-dropdown-menu a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {

    
    .main-nav,
    .newadd-icon {
        display: none;
    }

    .country-switcher {
        margin-left: 0.5rem;
        order: -1;
        /* Move before other elements on mobile */
    }

    .country-switcher-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .country-switcher-btn span {
        display: none;
        /* Hide country name on very small screens */
    }

    .country-dropdown-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-nav {
        height: 100%;
        position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    background: var(--helperColor);
    z-index: 999;
    transition: right 0.5s ease-in-out;
    display: flex;
    /* flex-direction: column; */
    padding-top: 4rem;
    overflow: scroll;
  

    }

   
    
.mobile-nav.active {
    right: 0;
}

.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* لون غامق شفاف */
   display: none;
    z-index: 999; /* أقل من المينيو بشوية */
  }
  
  .menu-overlay.active {
   display: block;
  }

    .mobile-nav ul{
        position: absolute;
        display: flex;
        flex-direction: column;
        top: 0px;
        left: 0;
        height: 100vh;
        width: 100%;
        transition: all 0.4s ease-in-out;
        background: var(--helperColor);
        box-shadow: 0 11px 10px rgb(0 0 0 / 20%);



    }
    .mobile-nav.active ul{
        position: absolute;
        display: flex;
        flex-direction: column;
        top: 0px;
        left: 0;
        height: 100vh;
        width: 100%;
        transition: all 0.4s ease-in-out;
    }
    .mobile-nav a {
        display: block;
        padding: 0.75rem 1rem;
        color: #ffffff;
        text-decoration: none;
        border-bottom: 1px solid #004081;
    }
    
    .mobile-nav a:hover {
        background: var(--helperColor);
        ;
    }
    .mobile-nav.active .country-dropdown{
        top:100%;
        left: 0;
        width:100%;
    }

    .jobs-grid {
        grid-template-columns: 1fr;
    }

    .seekers-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: .5rem;
    }

    .scholarships-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .categories-wrapper {
        gap: 1rem;
    }

    .category-item {
        min-width: 120px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .section-header {
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        padding: 0.5rem 0;
    }

    .logo img {
        height: 30px;
    }

    .user-actions {
        gap: 0.5rem;
    }

    .country-switcher-btn .flag-icon {
        width: 20px;
        height: 15px;
    }

    .country-dropdown-item .flag-icon {
        width: 20px;
        height: 15px;
    }

    .seeker-card .verified-badge svg {
        margin-top: .25rem;
    }

    .seeker-details .verified-badge svg {
        margin-top: 0rem;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .login-btn,
    .post-ad-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
