.modern-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: "B Nazanin", sans-serif;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;

}
.language-selector {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.language-dropdown {
    display: none;
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    min-width: 120px;
    z-index: 1000;
    text-align: right;
}

.language-dropdown button {
    background: none;
    border: none;
    padding: 8px 12px;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

.language-dropdown button:hover,
.language-dropdown .active {
    background-color: #f0f0f0;
}

.language-dropdown.show {
    display: block;
}

.header-logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-text {
    font-family: "B Titr", sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-container {
    position: relative;
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.header-search form {
    display: contents;
}
.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: "B Nazanin", sans-serif;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #ff5252;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.download-btn,
.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "B Nazanin", sans-serif;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.download-btn:hover,
.profile-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.language-select {
    display: none;
}

.language-select option {
    background: #333;
    color: white;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 0.5rem;
}

.language-selector:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown a {
    display: block;
    padding: 0.7rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
    font-family: "B Nazanin", sans-serif;
}

.language-dropdown a:hover {
    background: #f5f5f5;
}

.main-navigation {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-menu li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-family: "B Nazanin", sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.nav-menu li a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .modern-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    .top-header {
        flex-direction: column;
        gap: 1rem;
        padding: 0.8rem 0;
    }

    .header-logo {
        order: 1;
    }

    .header-actions {
        order: 2;
        justify-content: center;
        gap: 1.5rem;
        width: 100%;
    }

    .header-search {
        order: 3;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .download-btn,
    .profile-btn,
    .language-btn {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    /* Navigation responsive */
    .main-navigation {
        padding: 0.5rem 0;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
        justify-content: center;
    }

    .nav-menu li a {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        border-radius: 15px;
    }
}