/* Language Switcher for bildhub Theme */
.language-switcher {
    position: relative;
    z-index: 999;
    flex-shrink: 0;
    display: inline-block;
}

/* Ensure header buttons are displayed horizontally */
.header-button.d-flex {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 15px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
}

.header-button .thm-btn {
    order: 1;
    flex-shrink: 0;
}

.header-button .language-switcher {
    order: 2;
    flex-shrink: 0;
}

.language-btn {
    background: transparent;
    border: 2px solid #ff5e15;
    border-radius: 6px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #ff5e15;
    cursor: pointer;
    transition: all 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: #ff5e15;
    transition: all 0.3s ease-in-out;
    z-index: -1;
}

.language-btn:hover::before {
    left: 0;
}

.language-btn:hover {
    color: #fefefe;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 94, 21, 0.3);
    border-color: #ff5e15;
}

.language-btn img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    object-fit: cover;
}

.language-btn:hover img {
    transform: scale(1.05);
}

.language-btn i {
    font-size: 12px;
    color: #ff5e15;
    margin-left: 4px;
    transition: all 0.3s ease-out;
}

.language-btn:hover i {
    color: #fefefe;
}

.language-btn.active i {
    transform: rotate(180deg);
}

.language-btn span {
    font-weight: 600;
    font-size: 13px;
}

/* Dropdown Menu */
.language-switcher .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #ff5e15;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 32, 82, 0.15);
    padding: 8px 0;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease-out;
    z-index: 1000;
    min-width: 120px;
}

.language-switcher .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher .dropdown-menu li {
    list-style: none;
    margin: 0;
}

.language-switcher .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #002052;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease-out;
    border: none;
    background: transparent;
}

.language-switcher .dropdown-menu .dropdown-item:hover {
    background-color: #ff5e15;
    color: #fefefe;
    transform: translateX(5px);
}

.language-switcher .dropdown-menu .dropdown-item img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.language-switcher .dropdown-menu .dropdown-item:hover img {
    transform: scale(1.1);
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 0;
    margin-top: 15px;
}

.mobile-lang-wrapper {
    position: relative;
}

.mobile-language-switcher .language-btn.mobile {
    width: 100%;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: #fff;
    border: 2px solid #ff5e15;
    border-radius: 8px;
    color: #002052;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 94, 21, 0.15);
    transition: all 0.3s ease-out;
}

.mobile-language-switcher .language-btn.mobile:hover,
.mobile-language-switcher .language-btn.mobile.active {
    background-color: #ff5e15;
    color: #fefefe;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 94, 21, 0.25);
}

.mobile-language-switcher .language-btn.mobile .fas {
    transition: transform 0.3s ease;
}

.mobile-language-switcher .language-btn.mobile.active .fas {
    transform: rotate(180deg);
}

.mobile-language-switcher .dropdown-menu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 10px 0 0;
    margin-top: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
}

.mobile-language-switcher .dropdown-menu.show {
    display: block;
}

.mobile-language-switcher .dropdown-menu .dropdown-item {
    padding: 14px 20px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: all 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-language-switcher .dropdown-menu .dropdown-item:hover {
    background-color: #ff5e15;
    border-color: #ff5e15;
    color: #fefefe;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(255, 94, 21, 0.3);
}

.mobile-language-switcher .dropdown-menu .dropdown-item:last-child {
    margin-bottom: 0;
}

.mobile-language-switcher .dropdown-menu .dropdown-item img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mobile-language-switcher .dropdown-menu .dropdown-item span {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Desktop specific styles */
@media (min-width: 992px) {
    .header-button.d-flex {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-direction: row !important;
        gap: 15px !important;
        flex-wrap: nowrap !important;
    }

    .header-button .language-switcher {
        display: block !important;
        margin-left: 15px;
        margin-right: 0;
        order: 2;
    }

    .header-button .thm-btn {
        flex-shrink: 0;
        white-space: nowrap;
        order: 1;
        margin-right: 0;
    }

    /* Ensure proper spacing */
    .header-button-area .header-button {
        float: right;
    }
}

/* Large screens - Ensure horizontal layout */
@media (min-width: 1200px) {
    .header-button.d-flex {
        min-width: auto;
        width: auto;
    }

    .header-button .thm-btn {
        margin-right: 15px;
    }

    .header-button .language-switcher {
        margin-left: 0;
    }
}

/* Responsive Design */
@media (max-width: 991px) {
    .language-switcher {
        display: none !important;
    }

    .header-button {
        justify-content: center !important;
        flex-direction: column !important;
    }
}

@media (max-width: 767px) {
    .mobile-language-switcher {
        padding: 15px 0;
    }

    .mobile-language-switcher .language-btn.mobile {
        font-size: 14px;
        padding: 14px 18px;
    }

    .mobile-language-switcher .dropdown-menu .dropdown-item {
        font-size: 13px;
        padding: 12px 18px;
    }

    .mobile-language-switcher .dropdown-menu .dropdown-item img {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .mobile-language-switcher .language-btn.mobile {
        font-size: 13px;
        padding: 12px 16px;
    }

    .mobile-language-switcher .dropdown-menu .dropdown-item {
        font-size: 12px;
        padding: 10px 16px;
        margin-bottom: 6px;
    }
}

/* Animation for smooth transitions */
.language-switcher .dropdown-menu li {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}

.language-switcher .dropdown-menu.show li:nth-child(1) {
    animation-delay: 0.1s;
}

.language-switcher .dropdown-menu.show li:nth-child(2) {
    animation-delay: 0.15s;
}

.language-switcher .dropdown-menu.show li:nth-child(3) {
    animation-delay: 0.2s;
}

.language-switcher .dropdown-menu.show li:nth-child(4) {
    animation-delay: 0.25s;
}

.language-switcher .dropdown-menu.show li:nth-child(5) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}