/**
 * BONZU Language Switcher v2 Styles
 * @since 2.0.0
 */

/* BASE */
.lang-switcher {
    position: relative;
    display: inline-flex;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* FLOATING */
.lang-switcher--floating {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
}

@media (max-width: 768px) {
    .lang-switcher--floating { top: 12px; right: 12px; }
}

/* CURRENT BUTTON */
.lang-switcher__current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(31, 47, 36, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #FFF;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.lang-switcher__current:hover {
    background: rgba(31, 47, 36, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

.lang-switcher__current:focus-visible {
    outline: 2px solid rgba(191, 167, 122, 0.6);
    outline-offset: 2px;
}

.lang-switcher__current svg:first-child {
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.lang-switcher__label { font-size: 13px; font-weight: 500; }

.lang-switcher__arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.5;
    margin-left: 2px;
}

.lang-switcher--open .lang-switcher__arrow { transform: rotate(180deg); }

/* DROPDOWN */
.lang-switcher__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 130px;
    background: #FFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 10px 20px -3px rgba(0,0,0,0.1);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.lang-switcher--open .lang-switcher__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* OPTIONS */
.lang-switcher__option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: #2C2C2C;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    line-height: 1;
}

.lang-switcher__option:hover { background: rgba(31, 47, 36, 0.05); }

.lang-switcher__option:focus-visible {
    outline: 2px solid rgba(191, 167, 122, 0.5);
    outline-offset: -2px;
}

.lang-switcher__option--active {
    font-weight: 600;
    color: #1F2F24;
    background: rgba(31, 47, 36, 0.06);
}

.lang-switcher__option--active::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #1F2F24;
    border-radius: 50%;
    margin-left: auto;
}

.lang-switcher__option svg {
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* LOADING INDICATOR */
#bonzu-lang-loading {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 47, 36, 0.9);
    backdrop-filter: blur(12px);
    color: #FFF;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    align-items: center;
    gap: 10px;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bonzu-lang-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #FFF;
    border-radius: 50%;
    animation: bonzu-spin 0.6s linear infinite;
}

@keyframes bonzu-spin {
    to { transform: rotate(360deg); }
}

/* HEADER INLINE */
.site-header .lang-switcher__current,
.header-actions .lang-switcher__current,
.site-header__actions .lang-switcher__current {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: none;
    padding: 6px 10px;
}

.site-header .lang-switcher__current:hover,
.header-actions .lang-switcher__current:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .lang-switcher__current, .lang-switcher__dropdown,
    .lang-switcher__option, .lang-switcher__arrow,
    .bonzu-lang-spinner { transition: none; animation: none; }
}
