/* Language Switcher Widget */
.lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-switcher-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    color: #1A6355;
    font-family: 'Fira Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.lang-switcher-trigger:hover {
    background: rgba(26, 99, 85, 0.08);
}

.lang-switcher-flag {
    border-radius: 2px;
    object-fit: cover;
}

.lang-code {
    letter-spacing: 0.5px;
}

.lang-switcher-arrow {
    transition: transform 0.2s ease;
}

.lang-switcher-dropdown.active + .lang-switcher-trigger .lang-switcher-arrow,
.lang-switcher:has(.lang-switcher-dropdown.active) .lang-switcher-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.lang-switcher-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    overflow: hidden;
}

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

/* Language Option */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #4D4D4D;
    text-decoration: none;
    font-family: 'Fira Sans', sans-serif;
    font-size: 13px;
    transition: background 0.15s ease;
}

.lang-option:hover {
    background: #FFF3E5;
    color: #1A6355;
}

.lang-option.active {
    color: #1A6355;
    font-weight: 500;
    background: rgba(26, 99, 85, 0.05);
}

.lang-option img {
    border-radius: 2px;
    object-fit: cover;
}

.lang-option span {
    flex: 1;
}

.lang-check {
    color: #1A6355;
    flex-shrink: 0;
}

/* Footer integration - globe + pill button style */
.footer-lang-item {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding-left: 12px;
}

.footer-lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 10px;
}

.footer-lang-switcher .fa-globe {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-lang-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Fira Sans', sans-serif;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.footer-lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    text-decoration: none;
}

.footer-lang-btn.active {
    background: #fff;
    border-color: #fff;
    color: #1A6355;
}

.footer-lang-btn.active:hover {
    background: #fff;
    color: #1A6355;
}

/* Admin panel integration */
.admin-lang-item {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    padding-right: 10px;
}

.admin-lang-item .lang-switcher-trigger {
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    opacity: 0.85;
}

.admin-lang-item .lang-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

/* Admin dropdown opens downward */
.admin-lang-item .lang-switcher-dropdown {
    top: calc(100% + 8px);
    right: 0;
}

/* Ensure dropdown text color in admin context */
.admin-lang-item .lang-option {
    color: #4D4D4D;
}

.admin-lang-item .lang-option:hover {
    color: #1A6355;
}

.admin-lang-item .lang-option.active {
    color: #1A6355;
}

/* Hide admin lang on mobile (use bottom sheet instead) */
@media (max-width: 768px) {
    .admin-lang-item {
        display: none;
    }
}
