/* Language Switcher - floating globe button */
.lang-switcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}

.lang-switcher-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.lang-switcher-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #334155;
}

/* Dark mode */
.dark-mode .lang-switcher-btn {
    background: #1e293b;
    border-color: #374151;
    color: #94a3b8;
}

.dark-mode .lang-switcher-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

/* Dropdown menu */
.lang-switcher-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    min-width: 130px;
}

.lang-switcher-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dark-mode .lang-switcher-menu {
    background: #1e293b;
    border-color: #374151;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Language option buttons */
.lang-option {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.lang-option.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
}

.dark-mode .lang-option {
    color: #94a3b8;
}

.dark-mode .lang-option:hover {
    background: #334155;
    color: #e2e8f0;
}

.dark-mode .lang-option.active {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* Mobile: hide floating switcher, use inline version instead */
@media (max-width: 768px) {
    .lang-switcher {
        display: none;
    }
}

/* Inline language bar (mobile fallback for non-compare pages) */
.lang-bar {
    display: none;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .lang-bar {
        display: flex;
    }
}

.lang-bar-btn {
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lang-bar-btn.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 600;
}

.dark-mode .lang-bar-btn {
    border-color: #374151;
    color: #94a3b8;
}

.dark-mode .lang-bar-btn.active {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

/* Compare page settings panel language selector */
.settings-lang-options {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.settings-lang-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #94a3b8;
    font-size: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.settings-lang-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.settings-lang-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 600;
}
