/**
 * Projet FSE Denfert Rochereau - CSS principal
 * 
 * Ce fichier contient les styles CSS spécifiques au projet Django
 * pour la gestion de l'interface utilisateur personnalisée
 */

/* ========================================
   VARIABLES CSS PROJET
   ======================================== */

:root {
    /* Couleurs principales du projet FSE */
    --fse-primary: #007bff;
    --fse-secondary: #6c757d;
    --fse-success: #28a745;
    --fse-info: #17a2b8;
    --fse-warning: #ffc107;
    --fse-danger: #dc3545;
    --fse-light: #f8f9fa;
    --fse-dark: #343a40;
    
    /* Couleurs du FSE Denfert Rochereau */
    --fse-accent: #2c3e50;
    --fse-highlight: #e74c3c;
    
    /* Espacements */
    --fse-spacing-xs: 0.25rem;
    --fse-spacing-sm: 0.5rem;
    --fse-spacing-md: 1rem;
    --fse-spacing-lg: 1.5rem;
    --fse-spacing-xl: 3rem;
    
    /* Bordures */
    --fse-border-radius: 0.375rem;
    --fse-border-radius-lg: 0.5rem;
    
    /* Ombres */
    --fse-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --fse-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --fse-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ========================================
   UTILITAIRES GÉNÉRAUX
   ======================================== */

/* Classe utilitaire pour masquer visuellement mais garder accessible */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Classe pour les éléments focus accessibles */
.focus-visible {
    outline: 2px solid var(--fse-primary);
    outline-offset: 2px;
}

/* ========================================
   STYLES POUR LES FORMULAIRES
   ======================================== */

.form-fse {
    background: white;
    border-radius: var(--fse-border-radius-lg);
    box-shadow: var(--fse-shadow-sm);
    padding: var(--fse-spacing-lg);
}

.form-fse .form-label {
    font-weight: 600;
    color: var(--fse-dark);
    margin-bottom: var(--fse-spacing-sm);
}

.form-fse .form-control:focus {
    border-color: var(--fse-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========================================
   STYLES POUR LES CARTES
   ======================================== */

.card-fse {
    border: none;
    border-radius: var(--fse-border-radius-lg);
    box-shadow: var(--fse-shadow-sm);
    transition: all 0.3s ease;
}

.card-fse:hover {
    box-shadow: var(--fse-shadow);
    transform: translateY(-2px);
}

.card-fse .card-header {
    background: linear-gradient(135deg, var(--fse-primary), #0056b3);
    color: white;
    border-radius: var(--fse-border-radius-lg) var(--fse-border-radius-lg) 0 0 !important;
    padding: var(--fse-spacing-md) var(--fse-spacing-lg);
}

.card-fse .card-body {
    padding: var(--fse-spacing-lg);
}

/* ========================================
   STYLES POUR LES BOUTONS
   ======================================== */

.btn-fse {
    border-radius: var(--fse-border-radius);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-fse:hover {
    transform: translateY(-1px);
    box-shadow: var(--fse-shadow-sm);
}

.btn-fse-primary {
    background-color: var(--fse-primary);
    border-color: var(--fse-primary);
    color: white;
}

.btn-fse-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* ========================================
   STYLES POUR LES ALERTES
   ======================================== */

.alert-fse {
    border: none;
    border-radius: var(--fse-border-radius-lg);
    border-left: 4px solid;
    padding: var(--fse-spacing-md) var(--fse-spacing-lg);
    margin-bottom: var(--fse-spacing-md);
}

.alert-fse-info {
    background-color: #e3f2fd;
    border-left-color: var(--fse-info);
    color: #0c5460;
}

.alert-fse-success {
    background-color: #e8f5e8;
    border-left-color: var(--fse-success);
    color: #155724;
}

.alert-fse-warning {
    background-color: #fff8e1;
    border-left-color: var(--fse-warning);
    color: #856404;
}

.alert-fse-danger {
    background-color: #f8d7da;
    border-left-color: var(--fse-danger);
    color: #721c24;
}

/* ========================================
   STYLES POUR LA MISE À JOUR DE BASE DE DONNÉES
   ======================================== */

.update-db-container {
    max-width: 800px;
    margin: 0 auto;
}

.update-db-progress {
    background: white;
    border-radius: var(--fse-border-radius-lg);
    box-shadow: var(--fse-shadow);
    padding: var(--fse-spacing-xl);
    text-align: center;
}

.update-db-spinner {
    width: 3rem;
    height: 3rem;
    margin: 0 auto var(--fse-spacing-lg);
}

.update-db-progress-bar {
    height: 1rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, var(--fse-primary), #0056b3);
    animation: progress-bar-stripes 1s linear infinite;
    background-size: 1rem 1rem;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* ========================================
   STYLES RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .card-fse .card-body {
        padding: var(--fse-spacing-md);
    }
    
    .form-fse {
        padding: var(--fse-spacing-md);
    }
    
    .update-db-progress {
        padding: var(--fse-spacing-lg);
    }
}

/* ========================================
   STYLES POUR L'ACCESSIBILITÉ
   ======================================== */

/* Réduction des animations pour les utilisateurs qui le préfèrent */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mode sombre pour les utilisateurs qui le préfèrent */
@media (prefers-color-scheme: dark) {
    .form-fse,
    .card-fse {
        background-color: #2d3748;
        color: white;
    }
    
    .form-fse .form-control {
        background-color: #4a5568;
        border-color: #4a5568;
        color: white;
    }
    
    .form-fse .form-control:focus {
        background-color: #4a5568;
        border-color: var(--fse-primary);
        color: white;
    }
}