/**
 * TECHenya Multilingual — Language Switcher Styles
 *
 * @package TECHenya_Multilingual
 */

/* ─── Language Switcher Container ─────────────────────── */
.te-lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 100;
}

/* ─── Current Language Button ─────────────────────────── */
.te-lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
}

.te-lang-current:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Scrolled header state */
.te-header--scrolled .te-lang-current {
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.te-header--scrolled .te-lang-current:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

/* ─── Flag Icon ───────────────────────────────────────── */
.te-lang-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ─── Language Code ───────────────────────────────────── */
.te-lang-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ─── Arrow Icon ──────────────────────────────────────── */
.te-lang-arrow {
    width: 12px;
    height: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

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

/* ─── Dropdown Menu ───────────────────────────────────── */
.te-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 6px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

/* ─── Dropdown Option ─────────────────────────────────── */
.te-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease;
    font-size: 14px;
}

.te-lang-option:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.te-lang-option .te-lang-flag {
    width: 24px;
    height: 16px;
}

/* ─── Fixed Position Switcher (fallback) ──────────────── */
.te-lang-switcher-fixed {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 9998;
}

.te-lang-switcher-fixed .te-lang-current {
    background: white;
    border-color: #e2e8f0;
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.te-lang-switcher-fixed .te-lang-dropdown {
    bottom: calc(100% + 8px);
    top: auto;
    transform: translateY(10px);
}

.te-lang-switcher-fixed.open .te-lang-dropdown {
    transform: translateY(0);
}

/* ─── RTL Adjustments ─────────────────────────────────── */
[dir="rtl"] .te-lang-switcher {
    direction: rtl;
}

[dir="rtl"] .te-lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .te-lang-switcher-fixed {
    right: auto;
    left: 20px;
}

/* ─── Mobile Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .te-lang-code {
        display: none;
    }

    .te-lang-current {
        padding: 6px 8px;
    }

    .te-lang-dropdown {
        right: -10px;
        min-width: 140px;
    }

    .te-lang-switcher-fixed {
        bottom: 90px;
        right: 15px;
    }
}
