/* Language Toggle Switch Styles */
.language-toggle {
    display: flex;
    align-items: center;
    margin-left: 20px;
    position: relative;
}

.language-switch {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 32px;
}

.language-switch:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-option {
    position: relative;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 16px;
    z-index: 2;
    min-width: 38px;
    text-align: center;
    user-select: none;
}

.language-option.active {
    color: #333;
    font-weight: 600;
}

.language-option:not(.active):hover {
    color: rgba(255, 255, 255, 0.9);
}

.language-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
    transform: translateX(0);
}

.language-switch[data-lang="en"] .language-slider {
    transform: translateX(100%);
}

/* Mobile optimized styles */
@media (max-width: 768px) {
    .language-toggle {
        margin: 0;
        padding: var(--spacing-xs) var(--spacing-sm);
        order: 1;
        flex-shrink: 0;
    }

    .language-switch {
        background-color: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        min-width: 90px;
    }

    .language-option {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-width: 40px;
    }

    .language-switch:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .language-toggle {
        margin-left: 15px;
    }

    .language-option {
        padding: 7px 14px;
        font-size: 0.85rem;
        min-width: 42px;
    }
}

/* Smooth animation for language transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.language-switch.switching {
    pointer-events: none;
}

.language-switch.switching .language-slider {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Accessibility improvements */
.language-option:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .language-switch,
    .language-option,
    .language-slider {
        transition: none;
    }
}

/* Styles pour dropdown moderne (3+ langues) */
.language-dropdown-modern {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}

.language-dropdown-btn-modern {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 32px;
    min-width: 80px;
    justify-content: space-between;
}

.language-dropdown-btn-modern:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-dropdown-btn-modern i {
    margin-left: 8px;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.language-dropdown-btn-modern[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.language-dropdown-content-modern {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-radius: 12px;
    overflow: hidden;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 0;
    list-style: none;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
}

.language-dropdown-content-modern.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.language-dropdown-content-modern li {
    margin: 0;
}

.language-option-modern {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 8px;
}

.language-option-modern:hover {
    background-color: #f5f5f5;
    color: var(--color-fuschia);
}

.language-option-modern.active {
    background-color: var(--color-grenade);
    color: white;
}

/* Mobile styles pour dropdown moderne */
@media (max-width: 768px) {
    .language-dropdown-modern {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        order: 1;
        position: relative;
        display: block !important; /* Force display on mobile */
    }

    .language-dropdown-btn-modern {
        width: calc(100% - 2rem);
        max-width: 100%;
        min-width: auto;
        padding: 12px 16px;
        background-color: rgba(255, 255, 255, 0.15);
        box-sizing: border-box;
        margin: 0.5rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .language-dropdown-content-modern {
        width: calc(100% - 2rem);
        margin: 0 1rem;
        margin-top: 5px;
        right: auto;
        left: auto;
        z-index: 1000;
        position: absolute;
    }

    .language-option-modern {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    /* Hide toggle version on mobile (we use dropdown) */
    .language-toggle {
        display: none !important;
    }
}