/**
 * Language Switcher Styles
 * Mobile-first approach
 */

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

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

.tib-lang-current:hover {
    border-color: #3068b3;
    box-shadow: 0 2px 8px rgba(48, 104, 179, 0.1);
}

.tib-lang-current:focus {
    outline: 2px solid #3068b3;
    outline-offset: 2px;
}

.tib-lang-current .flag {
    font-size: 18px;
    line-height: 1;
}

.tib-lang-current .lang-code {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tib-lang-current .chevron {
    transition: transform 0.2s;
}

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

/* Dropdown */
.tib-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

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

.tib-lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    font-size: 14px;
}

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

.tib-lang-option:focus {
    outline: 2px solid #3068b3;
    outline-offset: -2px;
}

.tib-lang-option.active {
    background: #e3f2fd;
    color: #3068b3;
    font-weight: 600;
}

.tib-lang-option .flag {
    font-size: 20px;
    line-height: 1;
}

.tib-lang-option .lang-name {
    flex: 1;
}

.tib-lang-option .check {
    color: #3068b3;
    flex-shrink: 0;
}

/* Loading state */
body.tib-lang-switching {
    cursor: wait;
}

body.tib-lang-switching * {
    pointer-events: none;
}

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

    .tib-lang-current {
        padding: 6px 10px;
        font-size: 13px;
    }

    .tib-lang-current .flag {
        font-size: 16px;
    }

    .tib-lang-option {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Scrollbar for dropdown */
.tib-lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.tib-lang-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tib-lang-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

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