/* ============================================
   eGrow Help Centre - Language Switcher Styles
   ============================================ */

/* Language Switcher Container */
.lang-switcher {
    position: relative;
}

/* Language Button */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.lang-btn:focus {
    outline: 2px solid #0A8F7A;
    outline-offset: 2px;
}

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

.lang-btn .chevron {
    transition: transform 0.2s ease;
}

.lang-switcher.open .lang-btn .chevron {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

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

/* Dropdown Header */
.lang-dropdown-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9CA3AF;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
}

/* Language Option */
.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.lang-option:hover {
    background: #F3F4F6;
}

.lang-option.active {
    background: linear-gradient(135deg, rgba(10, 143, 122, 0.08), rgba(28, 191, 148, 0.08));
}

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

.lang-option .lang-info {
    flex: 1;
}

.lang-option .lang-name {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
}

.lang-option .lang-native {
    font-size: 12px;
    color: #6B7280;
}

.lang-option .check {
    color: #0A8F7A;
    opacity: 0;
    flex-shrink: 0;
}

.lang-option.active .check {
    opacity: 1;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

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

[dir="rtl"] .lang-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-option {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-option .lang-info {
    text-align: right;
}

/* RTL adjustments for common elements */
[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .flex-row-reverse {
    flex-direction: row;
}

[dir="rtl"] .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .mr-auto {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* RTL for navigation items - don't reverse nav flex */
[dir="rtl"] nav .flex {
    flex-direction: row;
}

[dir="rtl"] .gap-2 {
    gap: 0.5rem;
}

[dir="rtl"] .gap-3 {
    gap: 0.75rem;
}

[dir="rtl"] .gap-4 {
    gap: 1rem;
}

/* Arrow icons flip for RTL */
[dir="rtl"] .arrow-icon,
[dir="rtl"] .chevron-right {
    transform: scaleX(-1);
}

/* Toast animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

/* Mobile responsive */
@media (max-width: 640px) {
    .lang-dropdown {
        min-width: 180px;
    }
    
    .lang-btn {
        padding: 6px 10px;
    }
    
    .lang-btn .flag {
        font-size: 16px;
    }
    
    .lang-option {
        padding: 10px 14px;
    }
    
    .lang-option .flag {
        font-size: 20px;
    }
}

/* Keyboard navigation focus styles */
.lang-option:focus {
    outline: none;
    background: #E5E7EB;
}

.lang-option:focus.active {
    background: linear-gradient(135deg, rgba(10, 143, 122, 0.15), rgba(28, 191, 148, 0.15));
}

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

.lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 2px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

