/* ═══════════════════════════════════════
   LANGUAGE TOGGLE SWITCH
   ═══════════════════════════════════════ */

.lang-switch-container {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 0 !important;
    z-index: 1000;
}

.lang-toggle {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 100px;
    padding: 4px;
    position: relative;
    cursor: pointer;
    gap: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lang-toggle:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Sliding background indicator */
.lang-toggle-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(0, 0, 0, 0.07);
    border-radius: 100px;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.15, 1);
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.lang-toggle.lang-cz .lang-toggle-indicator {
    transform: translateX(100%);
}

/* Individual language option */
.lang-toggle-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 100px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: opacity 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.lang-toggle-option img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s ease, filter 0.4s ease, opacity 0.4s ease;
}

.lang-toggle-option:hover img {
    transform: scale(1.1);
}

/* Active state */
.lang-toggle-option.active img {
    transform: scale(1.05);
    filter: none;
    opacity: 1;
}

.lang-toggle-option.active span {
    color: rgba(0, 0, 0, 0.85);
}

.lang-toggle-option span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.3);
    transition: color 0.4s ease;
}

/* Inactive state */
.lang-toggle-option:not(.active) img {
    opacity: 0.4;
    filter: saturate(0.3) brightness(0.9);
}

.lang-toggle-option:not(.active):hover img {
    opacity: 0.7;
    filter: saturate(0.6);
}

/* ═══════════════════════════════════════
   LANGUAGE POP-UP TIP
   ═══════════════════════════════════════ */

.popup-tip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.08),
            0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    z-index: 1000;
    top: 58px;
    right: 20px;
    transform-origin: top right;
    animation: tipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    font-size: 0.85rem;
    color: #333;
}

@keyframes tipIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-4px);
    }
}

.popup-tip:before {
    content: '';
    position: absolute;
    top: -6px;
    right: 22px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(0, 0, 0, 0.06);
}

.popup-tip:after {
    content: '';
    position: absolute;
    top: -5px;
    right: 22px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(255, 255, 255, 0.95);
}

/* ═══════════════════════════════════════
   LANGUAGE TEXT TRANSITION
   ═══════════════════════════════════════ */

.translatable {
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    transform: translateY(0);
}

.lang-fade-out {
    opacity: 0;
    transform: translateY(-8px);
}

.lang-fade-in {
    opacity: 0;
    transform: translateY(8px);
}

.lang-active {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════ */

@media screen and (max-width: 736px) {
    .lang-switch-container {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 20px 0;
        padding: 1em !important;
        padding-top: 2em !important;
    }

    .popup-tip {
        position: absolute;
        top: auto;
        bottom: -55px;
        right: auto;
        transform-origin: top center;
    }

    .popup-tip:before,
    .popup-tip:after {
        right: 50%;
    }
}