/* Language Switcher Styles - Compatible with old browsers */

.language-switcher {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.lang-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.lang-icon {
    font-size: 18px;
    line-height: 1;
}

.lang-current {
    font-size: 14px;
}

.lang-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.lang-btn[aria-expanded="true"] .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.15s ease;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option:focus {
    background: #f0f0f0;
    outline: none;
}

.lang-option.active {
    background: #f8f9ff;
    color: #667eea;
    font-weight: 600;
}

.lang-option .checkmark {
    color: #667eea;
    font-size: 14px;
    margin-left: 8px;
}

/* Scrollbar styling for modern browsers */
.lang-dropdown::-webkit-scrollbar {
    width: 8px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 12px 12px 0;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .lang-dropdown {
        right: 0;
        left: auto;
        min-width: 160px;
    }
}

/* Old browser fallback - no flexbox */
.no-flexbox .lang-btn {
    display: inline-block;
}

.no-flexbox .lang-btn > * {
    display: inline-block;
    vertical-align: middle;
}
