/* Language Selector in Settings Panel */
.grax_tm_settings .languages {
    list-style-type: none;
    margin: 0px 0px 22px 0px;
    padding-top: 15px;
}

.grax_tm_settings .languages li {
    margin: 0px 8px 8px 0px;
    display: inline-block;
}

.grax_tm_settings .languages li a {
    text-decoration: none;
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    font-family: "Poppins", sans-serif;
    text-align: center;
    line-height: 40px;
    transition: all 0.3s ease;
    opacity: 0.5;
    border: 2px solid transparent;
}

.grax_tm_settings .languages li a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.15);
}

.grax_tm_settings .languages li a.active {
    opacity: 1;
    border-color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Dark mode adjustments */
body.dark .grax_tm_settings .languages li a,
.grax_tm_settings.changed .languages li a {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

body.dark .grax_tm_settings .languages li a:hover,
.grax_tm_settings.changed .languages li a:hover {
    background-color: rgba(0, 0, 0, 0.15);
}

body.dark .grax_tm_settings .languages li a.active,
.grax_tm_settings.changed .languages li a.active {
    border-color: #000;
    background-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Language specific styling */
.grax_tm_settings .languages li a.en {
    /* English flag inspired colors */
}

.grax_tm_settings .languages li a.id {
    /* Indonesia flag inspired colors */
}

.grax_tm_settings .languages li a.zh {
    /* Chinese flag inspired colors */
}

/* Animation for language change */
@keyframes languageFade {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

body.language-changed {
    animation: languageFade 0.5s ease;
}

/* Tooltip for language names */
.grax_tm_settings .languages li a:before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    pointer-events: none;
    z-index: 100;
}

.grax_tm_settings .languages li a:after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.grax_tm_settings .languages li a:hover:before,
.grax_tm_settings .languages li a:hover:after {
    opacity: 1;
    visibility: visible;
}

body.dark .grax_tm_settings .languages li a:before,
.grax_tm_settings.changed .languages li a:before {
    background-color: rgba(255, 255, 255, 0.95);
    color: #000;
}

body.dark .grax_tm_settings .languages li a:after,
.grax_tm_settings.changed .languages li a:after {
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grax_tm_settings .languages li a {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 12px;
    }
}

/* Pulse animation for active language */
@keyframes langPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
}

.grax_tm_settings .languages li a.active {
    animation: langPulse 2s ease-in-out infinite;
}

body.dark .grax_tm_settings .languages li a.active,
.grax_tm_settings.changed .languages li a.active {
    animation-name: langPulseDark;
}

@keyframes langPulseDark {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    }
}