/* Language Switcher Styles */
.language-switcher {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0.5rem;
    padding: 0.3rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
}

.lang-toggle {
    display: flex;
    gap: 0.3rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 45px;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 14px rgba(0, 0, 0, 0.22);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: #ef7b00;
    color: #fff;
    border-color: #ef7b00;
    box-shadow: 0 10px 24px rgba(239, 123, 0, 0.35);
}

.lang-btn.active:hover {
    background: #d6650f;
    border-color: #d6650f;
    transform: translateY(-1px);
}

.flag-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.lang-text {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-switcher {
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        padding: 0.25rem;
        width: auto;
    }

    .lang-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
        min-width: 40px;
    }

    .flag-icon {
        font-size: 0.75rem;
    }

    .lang-text {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .language-switcher {
        bottom: 0.4rem;
        left: 0.4rem;
        right: 0.4rem;
        padding: 0.2rem;
    }

    .lang-toggle {
        width: 100%;
        justify-content: space-between;
        gap: 0.2rem;
    }

    .lang-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.25rem 0.35rem;
    }
}

/* Alternative sidebar position for specific layouts */
.language-switcher.sidebar {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    background: linear-gradient(180deg, rgba(20, 28, 44, 0.9) 0%, rgba(12, 18, 30, 0.95) 100%);
    border-radius: 14px;
    padding: 0.7rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0.9rem 0;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.language-switcher.sidebar .lang-toggle {
    display: grid;
    grid-auto-rows: minmax(36px, auto);
    gap: 0.45rem;
    width: 100%;
}

.language-switcher.sidebar .lang-btn {
    width: 100%;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 16px rgba(0, 0, 0, 0.28);
}

.language-switcher.sidebar .lang-btn.active {
    background: linear-gradient(135deg, #ef7b00, #ff9a3d);
    border-color: rgba(239, 123, 0, 0.9);
    color: #fff;
    box-shadow: 0 12px 26px rgba(239, 123, 0, 0.35);
}

@media (min-width: 769px) {
    .language-switcher.sidebar .lang-toggle {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.6rem;
    }

    .language-switcher.sidebar .lang-btn {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .language-switcher.sidebar {
        padding: 0.55rem;
        margin: 0.75rem 0;
    }

    .language-switcher.sidebar .lang-btn {
        min-width: 0;
    }
}

/* Integration with existing sidebar styles */
.sidebar .language-switcher {
    border-color: rgba(255, 255, 255, 0.05);
}

.sidebar .lang-btn {
    font-family: inherit;
}

/* Dark theme adjustments */
.layout.dark .language-switcher {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

.layout.dark .lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.8);
}

.layout.dark .lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #000;
}

/* Animation for switching */
@keyframes languageSwitch {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.lang-btn.switching {
    animation: languageSwitch 0.3s ease;
}