/**
 * Language Switcher Styles
 *
 * @package PrinceAlbert
 */

/* Language Selector Container */
.language-selector {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

/* Current Language Button */
.lang-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-dark);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-secondary, 'Mulish', sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-dark, #4A5D4A);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lang-current:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--color-accent, #8A9A6E);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lang-current[aria-expanded="true"] {
    border-color: var(--color-accent, #8A9A6E);
}

.lang-code {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lang-icon {
    font-size: 1.125rem;
    opacity: 0.7;
}

/* Dropdown Menu */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-medium);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    overflow: hidden;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Language Option */
.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: var(--color-text-dark, #4A5D4A);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--color-border-light);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: var(--color-accent-light);
    color: var(--color-accent, #8A9A6E);
}

.lang-option.active {
    background: var(--color-accent-light);
    color: var(--color-accent, #8A9A6E);
    font-weight: 600;
}

.lang-option.active::after {
    content: '✓';
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

.lang-native {
    font-size: 0.9375rem;
}

.lang-code-small {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

/* RTL Language Option Styling */
.lang-option.rtl-lang .lang-native {
    font-family: 'Noto Sans Arabic', sans-serif;
    direction: rtl;
}

/* Dark Mode Variant */
.nav-scrolled .lang-current {
    background: rgba(255, 255, 255, 0.98);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-selector {
        top: 1rem;
        right: 1rem;
    }
    
    .lang-current {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .lang-icon {
        font-size: 1rem;
    }
    
    .lang-dropdown {
        min-width: 140px;
    }
    
    .lang-option {
        padding: 0.625rem 0.875rem;
    }
    
    .lang-native {
        font-size: 0.875rem;
    }
}

/* Animation for Dropdown Arrow */
.lang-current::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.lang-switcher:hover .lang-current::after,
.lang-switcher:focus-within .lang-current::after {
    transform: rotate(180deg);
}
