.cls-switcher {
    position: relative;
    display: inline-block;
    font-family: Arial, sans-serif;
}

.cls-current {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.cls-current img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
}

.cls-current .cls-arrow {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    transition: transform 0.3s;
}

.cls-switcher.active .cls-arrow {
    transform: rotate(180deg);
}

.cls-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    z-index: 1000;
    overflow: hidden; /* Ensure child elements respect parent boundaries */
    border-radius: 10px; /* Set default border radius */
}

.cls-switcher.active .cls-dropdown {
    display: block;
}

.cls-dropdown li {
    padding: 0;
}

.cls-dropdown a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    transition: background 0.2s;
    /* Debug: Check if this is overridden */
}

.cls-dropdown .cls-flag {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
}

.cls-dropdown .cls-lang-name {
    display: inline-block;
}

.cls-dropdown a:hover {
    background: #f0f0f0; /* Preserve hover background color */
    /* Debug: Check if this is overridden */
}

/* High specificity to ensure first and last items retain rounded corners on hover */
.cls-dropdown li:first-child a:hover,
.cls-dropdown li:last-child a:hover {
    border-radius: 10px !important; /* Force rounded corners on first and last items */
    background: #f0f0f0; /* Ensure hover background is applied */
}

/* Ensure middle items remain square on hover */
.cls-dropdown li:not(:first-child):not(:last-child) a:hover {
    border-radius: 0 !important; /* Force square corners on middle items */
}

/* Ensure responsiveness across devices */
@media (max-width: 768px) {
    .cls-current {
        padding: 6px 10px;
    }

    .cls-current img {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .cls-current .cls-arrow {
        width: 14px;
        height: 14px;
        margin-left: 6px;
    }

    .cls-dropdown {
        width: 100%;
        border-radius: 8px; /* Adjusted for mobile */
    }

    .cls-dropdown a {
        padding: 8px 10px;
    }

    .cls-dropdown .cls-flag {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    /* High specificity for mobile */
    .cls-dropdown li:first-child a:hover,
    .cls-dropdown li:last-child a:hover {
        border-radius: 8px !important; /* Force rounded corners on first and last items */
    }

    .cls-dropdown li:not(:first-child):not(:last-child) a:hover {
        border-radius: 0 !important; /* Force square corners on middle items */
    }
}