/* Language Switcher Styles */
.language-switcher {
    position: relative;
    margin-right: 15px;
}

.language-dropdown {
    position: relative;
}

.language-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-background);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: var(--color-primary);
    font-weight: 500;
}

.language-trigger:hover {
    background-color: rgba(var(--color-primary-rgb), 0.15);
    border-color: rgba(var(--color-primary-rgb), 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.2);
}

.dark-mode .language-trigger {
    background: rgba(var(--color-primary-rgb), 0.15);
    border-color: rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-primary);
}

.dark-mode .language-trigger:hover {
    background-color: rgba(var(--color-primary-rgb), 0.2);
    border-color: rgba(var(--color-primary-rgb), 0.4);
}

.language-current {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.language-short {
    font-weight: 700;
    min-width: 20px;
    background: var(--color-primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--color-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-arrow {
    transition: transform 0.3s ease;
}

.language-trigger[aria-expanded="true"] .language-arrow {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-dropdown.active .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background-color: var(--color-primary);
    color: white;
}

.language-option.active {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    position: relative;
}

.language-option.active::after {
    content: '✓';
    position: absolute;
    right: 15px;
    font-weight: bold;
    font-size: 14px;
    color: white;
}

.language-option.active .language-short {
    background: #ab8286;
    color: var(--color-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-option .language-short {
    font-weight: 700;
    min-width: 20px;
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
    padding: 2px 6px;
    font-size: 11px;
    text-align: center;
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    transition: all 0.2s ease;
}

.language-option .language-name {
    flex: 1;
    color: #2c2c2c;
    font-weight: 500;
}

.language-option .language-name {
    flex: 1;
}

/* Dark mode adjustments */
.dark-mode .language-menu {
    background: #1a1a1a;
    border-color: #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark-mode .language-option {
    color: #e5e5e5;
    border-color: #333333;
}

.dark-mode .language-option .language-name {
    color: #e5e5e5;
}

.dark-mode .language-option:hover {
    background-color: var(--color-primary);
    color: white;
}

.dark-mode .language-option:hover .language-name {
    color: white;
}

.dark-mode .language-option.active {
    background-color: var(--color-primary);
    color: white;
}

.dark-mode .language-option.active .language-name {
    color: white;
}

.dark-mode .language-option.active::after {
    color: white;
}

.dark-mode .language-option .language-short {
    background: rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-primary);
    border-color: rgba(var(--color-primary-rgb), 0.3);
}

.dark-mode .language-option.active .language-short {
    background: #ab8286;
    color: var(--color-primary);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 800;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .language-switcher {
        margin-right: 10px;
    }
    
    .language-trigger {
        padding: 6px 8px;
        background: rgba(var(--color-primary-rgb), 0.12);
        border-width: 1px;
    }
    
    .language-name {
        display: none !important;
    }
    
    .language-menu {
        min-width: 100px;
    }
    
    .language-option {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .language-option.active::after {
        right: 12px;
        font-size: 16px;
    }
}

/* RTL Support */
.rtl-enabled .language-switcher {
    margin-right: 0;
    margin-left: 15px;
}

.rtl-enabled .language-menu {
    right: auto;
    left: 0;
}

.rtl-enabled .language-current {
    flex-direction: row-reverse;
}

/* Animation improvements matching theme style */
.language-trigger {
    position: relative;
    overflow: hidden;
}

.language-trigger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(var(--color-primary-rgb), 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.language-trigger:hover::before {
    width: 100%;
    height: 100%;
}

/* Mobile Language Switcher for Sidebar */
.mobile-language-switcher {
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
    margin-top: 20px;
}

.mobile-language-switcher .language-title {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-language-switcher .language-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
}

.mobile-language-option:hover {
    background-color: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

.mobile-language-option.active {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
    transform: translateX(3px);
}

.mobile-language-option .language-flag {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    font-size: 12px;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-language-option.active .language-flag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.mobile-language-option .language-name {
    flex: 1;
    font-weight: 500;
}

.mobile-language-option .language-check {
    opacity: 1;
    transform: scale(1);
    transition: all 0.2s ease;
}

/* Dark mode for mobile switcher */
.dark-mode .mobile-language-switcher {
    border-color: var(--color-border-dark);
}

.dark-mode .mobile-language-switcher .language-title {
    color: var(--color-text-dark);
}

.dark-mode .mobile-language-option {
    color: var(--color-text-dark);
}

.dark-mode .mobile-language-option:hover {
    background-color: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

.dark-mode .mobile-language-option .language-flag {
    background: rgba(255, 255, 255, 0.1);
}
