/* ========================================
   Phytoca Translator - Language Switcher
   ======================================== */

.phytoca-lang-switcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    direction: ltr;
}

/* Toggle Button */
.phytoca-lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #333;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    outline: none;
}

.phytoca-lang-toggle:hover {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.phytoca-lang-toggle:focus-visible {
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.phytoca-lang-toggle:active {
    transform: translateY(0);
}

/* Current Flag */
.phytoca-lang-current-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.phytoca-lang-current-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Arrow */
.phytoca-lang-arrow {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.6;
}

.phytoca-lang-switcher.open .phytoca-lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.phytoca-lang-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 6px;
}

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

/* Language Options */
.phytoca-lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 450;
    color: #374151;
    border-radius: 10px;
    transition: all 0.15s ease;
    text-align: left;
    line-height: 1;
    outline: none;
}

.phytoca-lang-option:hover {
    background: #f3f4f6;
    color: #111827;
}

.phytoca-lang-option:focus-visible {
    background: #f3f4f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) inset;
}

.phytoca-lang-option.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.phytoca-lang-option img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.phytoca-lang-option span {
    flex: 1;
}

/* Entrance Animation */
.phytoca-lang-switcher {
    animation: phytoca-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 0.8s;
}

@keyframes phytoca-slide-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .phytoca-lang-switcher {
        bottom: 16px;
        right: 16px;
    }

    .phytoca-lang-toggle {
        padding: 8px 14px;
    }

    .phytoca-lang-dropdown {
        min-width: 160px;
    }
}

/* Avoid conflict with WooCommerce or Elementor floating elements */
.phytoca-lang-switcher {
    contain: layout;
}
