/**
 * Language Switcher Styles
 * Compatible with Butterfly theme
 */

/* Language switcher container */
#language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    transition: all 0.3s ease;
}

/* Ensure post container is relative for absolute positioning */
#post {
    position: relative;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    #language-switcher {
        top: 10px;
        right: 10px;
    }
}

/* Language switch button */
.lang-switch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--font-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    text-decoration: none;
    opacity: 0.6;
}

.lang-switch-btn:hover {
    background: var(--text-bg-hover);
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.lang-switch-btn i {
    font-size: 18px;
}

/* Tooltip */
.lang-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    display: none;
    z-index: 101;
    pointer-events: none;
}

.lang-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border: 5px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.7);
}

/* Dark mode support */
[data-theme="dark"] .lang-switch-btn {
    color: var(--font-color);
}

[data-theme="dark"] .lang-switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Animation for attention hint */
@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }

    75% {
        transform: rotate(-5deg);
    }
}

.lang-switch-btn.animate {
    animation: wiggle 0.5s ease-in-out 2;
    /* Run twice */
    opacity: 1;
    /* Ensure visible */
}

/* Programmatic show for tooltip */
.lang-tooltip.show {
    display: block;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Single language notice */
.single-lang-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--font-color);
    border-radius: 8px;
    color: var(--font-color);
    font-size: 13px;
    opacity: 0.7;
}

.single-lang-notice i {
    font-size: 14px;
}