/**
 * Mode Toggle Component - Apprenant ⟷ Formateur
 * UX v2 - Clean Architecture
 */

.mode-toggle-container {
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.mode-toggle-switch {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.toggle-background {
    width: 240px;
    height: 40px;
    background: #e9ecef;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
}

.toggle-slider {
    width: 116px;
    height: 36px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 18px;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
}

.toggle-labels span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    z-index: 2;
    position: relative;
    padding: 0 8px;
}

.label-learner {
    color: #fff;
}

.label-trainer {
    color: #6c757d;
}

/* État Formateur actif */
.mode-toggle-switch.trainer .toggle-slider {
    transform: translateX(118px);
}

.mode-toggle-switch.trainer .label-learner {
    color: #6c757d;
}

.mode-toggle-switch.trainer .label-trainer {
    color: #fff;
}

/* Hover effect */
.mode-toggle-switch:hover .toggle-background {
    border-color: #007bff;
}

/* Animation de feedback */
.mode-toggle-switch.switching {
    pointer-events: none;
}

.mode-toggle-switch.switching .toggle-slider {
    animation: togglePulse 0.3s ease;
}

@keyframes togglePulse {
    50% { 
        transform: scale(1.05) translateX(59px); 
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .mode-toggle-container {
        margin: 0.5rem;
    }
    
    .toggle-background {
        width: 160px;
        height: 32px;
    }
    
    .toggle-slider {
        width: 76px;
        height: 28px;
    }
    
    .mode-toggle-switch.trainer .toggle-slider {
        transform: translateX(80px);
    }
    
    .toggle-labels span {
        font-size: 0.8rem;
    }
}