/* Badge du site dans le header */
.site-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: fadeIn 0.3s ease-in;
    transition: all 0.3s ease;
}

.site-badge-cgm {
    background-color: #198754;
    color: white;
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.3);
}
.site-badge-cgo {
    background-color: #0d6efd;
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}
.site-badge-scg {
    background-color: #3B2828;
    color: white;
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}
.site-badge-dcv {
    background-color: #66335B;
    color: white;
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}
.site-badge-123 {
    background-color: #fd7e14;
    color: white;
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

.site-badge-default {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Effet hover sur le badge */
.site-badge:hover {
    transform: scale(1.05);
    cursor: default;
}

/* Loading state pour le select */
#change_site_select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.site-loading {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #0d6efd !important;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

/* Animation du spinner */
@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Amélioration du select */
#change_site_select {
    border-radius: 6px !important;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#change_site_select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

#change_site_select:hover:not(:disabled) {
    border-color: #0d6efd;
}

/* Amélioration des options */
#change_site_select option {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Style pour la légende du site */
.legend-current-site {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: 8px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .site-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
        margin-left: 8px;
    }

    #change_site_select {
        font-size: 0.85rem;
    }

    .legend-current-site {
        font-size: 0.7rem;
        margin-left: 4px;
    }
}

@media (max-width: 576px) {
    .site-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
        margin-left: 5px;
    }

    .input-group.mb-3 {
        flex-direction: column;
        align-items: flex-start;
    }

    .legend-current-site {
        margin-left: 0;
        margin-top: 4px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .site-badge {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    }

    .legend-current-site {
        color: #adb5bd;
    }

    #change_site_select {
        background-color: #343a40;
        border-color: #495057;
        color: #fff;
    }

    #change_site_select:focus {
        background-color: #343a40;
        border-color: #0d6efd;
        color: #fff;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .site-badge,
    #change_site_select,
    .site-loading {
        animation: none;
        transition: none;
    }
}

/* Focus visible pour l'accessibilité */
.site-badge:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}
