/**
 * Système de Boutons Unifié - PaneBox
 * Version 1.0 - Octobre 2025
 * 
 * Centralise TOUS les styles de boutons pour une cohérence parfaite
 * Remplace toutes les définitions .btn-modern dispersées
 */

/* ========================================
   VARIABLES CSS POUR LES BOUTONS
   ======================================== */

:root {
    /* Couleurs de base */
    --btn-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --btn-success-gradient: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --btn-warning-gradient: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    --btn-danger-gradient: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    --btn-secondary-gradient: linear-gradient(135deg, #6c757d 0%, #5c636a 100%);
    --btn-info-gradient: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    --btn-light-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --btn-dark-gradient: linear-gradient(135deg, #343a40 0%, #23272b 100%);
    
    /* Ombres */
    --btn-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --btn-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --btn-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --btn-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   BOUTONS DE BASE - STYLE UNIFIÉ
   ======================================== */

.btn-unified,
.btn-modern {
    /* Structure de base */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    
    /* Dimensions */
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    
    /* Typographie */
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.025em;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    
    /* Apparence */
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    /* Transitions */
    transition: var(--btn-transition);
    
    /* Ombre de base */
    box-shadow: var(--btn-shadow-sm);
    
    /* États */
    user-select: none;
}

.btn-unified:hover,
.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-md);
    text-decoration: none;
}

.btn-unified:active,
.btn-modern:active {
    transform: translateY(0);
    box-shadow: var(--btn-shadow-sm);
}

.btn-unified:focus,
.btn-modern:focus {
    outline: 2px solid transparent;
    box-shadow: var(--btn-shadow-md), 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.btn-unified:disabled,
.btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   VARIANTES DE COULEURS
   ======================================== */

/* Primary */
.btn-unified.primary,
.btn-modern.primary,
.btn-unified-primary {
    background: var(--btn-primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-unified.primary:hover,
.btn-modern.primary:hover,
.btn-unified-primary:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Success */
.btn-unified.success,
.btn-modern.success,
.btn-unified-success {
    background: var(--btn-success-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-unified.success:hover,
.btn-modern.success:hover,
.btn-unified-success:hover {
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

/* Warning */
.btn-unified.warning,
.btn-modern.warning,
.btn-unified-warning {
    background: var(--btn-warning-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-unified.warning:hover,
.btn-modern.warning:hover,
.btn-unified-warning:hover {
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

/* Danger */
.btn-unified.danger,
.btn-modern.danger,
.btn-unified-danger {
    background: var(--btn-danger-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-unified.danger:hover,
.btn-modern.danger:hover,
.btn-unified-danger:hover {
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

/* Secondary */
.btn-unified.secondary,
.btn-modern.secondary,
.btn-unified-secondary {
    background: var(--btn-secondary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-unified.secondary:hover,
.btn-modern.secondary:hover,
.btn-unified-secondary:hover {
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

/* Info */
.btn-unified.info,
.btn-modern.info,
.btn-unified-info {
    background: var(--btn-info-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-unified.info:hover,
.btn-modern.info:hover,
.btn-unified-info:hover {
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.4);
}

/* Light */
.btn-unified.light,
.btn-modern.light,
.btn-unified-light {
    background: var(--btn-light-gradient);
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.btn-unified.light:hover,
.btn-modern.light:hover,
.btn-unified-light:hover {
    color: #343a40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark */
.btn-unified.dark,
.btn-modern.dark,
.btn-unified-dark {
    background: var(--btn-dark-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 58, 64, 0.3);
}

.btn-unified.dark:hover,
.btn-modern.dark:hover,
.btn-unified-dark:hover {
    box-shadow: 0 8px 20px rgba(52, 58, 64, 0.4);
}

/* ========================================
   VARIANTES DE TAILLE
   ======================================== */

/* Small */
.btn-unified.sm,
.btn-modern.sm,
.btn-unified-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
}

/* Large */
.btn-unified.lg,
.btn-modern.lg,
.btn-unified-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    border-radius: 0.625rem;
}

/* Extra Large */
.btn-unified.xl,
.btn-modern.xl,
.btn-unified-xl {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
}

/* ========================================
   VARIANTES OUTLINE (CONTOUR)
   ======================================== */

.btn-unified.outline,
.btn-modern.outline {
    background: transparent;
    border: 2px solid;
    box-shadow: none;
}

.btn-unified.outline.primary,
.btn-modern.outline.primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-unified.outline.primary:hover,
.btn-modern.outline.primary:hover {
    background: #667eea;
    color: #ffffff;
}

.btn-unified.outline.success,
.btn-modern.outline.success {
    border-color: #28a745;
    color: #28a745;
}

.btn-unified.outline.success:hover,
.btn-modern.outline.success:hover {
    background: #28a745;
    color: #ffffff;
}

.btn-unified.outline.warning,
.btn-modern.outline.warning {
    border-color: #ffc107;
    color: #ffc107;
}

.btn-unified.outline.warning:hover,
.btn-modern.outline.warning:hover {
    background: #ffc107;
    color: #ffffff;
}

.btn-unified.outline.danger,
.btn-modern.outline.danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-unified.outline.danger:hover,
.btn-modern.outline.danger:hover {
    background: #dc3545;
    color: #ffffff;
}

/* ========================================
   BOUTONS SPÉCIAUX POUR EN-TÊTES
   ======================================== */

.btn-header {
    /* Hérite des styles de base */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    
    /* Optimisé pour les en-têtes */
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--btn-transition);
    box-shadow: var(--btn-shadow-sm);
}

.btn-header:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-md);
    text-decoration: none;
}

.btn-header i {
    font-size: 1rem;
    opacity: 0.9;
}

/* ========================================
   GROUPES DE BOUTONS
   ======================================== */

.btn-group-unified {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-group-unified .btn-unified,
.btn-group-unified .btn-modern {
    margin: 0;
}

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

@media (max-width: 768px) {
    .btn-unified,
    .btn-modern {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .btn-unified.lg,
    .btn-modern.lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn-group-unified {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group-unified .btn-unified,
    .btn-group-unified .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ANIMATIONS ET EFFETS SPÉCIAUX
   ======================================== */

/* Effet de brillance au survol */
.btn-unified::before,
.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.btn-unified:hover::before,
.btn-modern:hover::before {
    left: 100%;
}

/* Pulse pour les boutons d'action importante */
.btn-unified.pulse,
.btn-modern.pulse {
    animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* ========================================
   COMPATIBILITÉ BOOTSTRAP
   ======================================== */

/* Override Bootstrap pour cohérence */
.btn.btn-unified,
.btn.btn-modern {
    border: none;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}

/* Classes de compatibilité - styles directs */
.btn-primary.btn-unified {
    background: var(--btn-primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success.btn-unified {
    background: var(--btn-success-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-warning.btn-unified {
    background: var(--btn-warning-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-danger.btn-unified {
    background: var(--btn-danger-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-secondary.btn-unified {
    background: var(--btn-secondary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ========================================
   OVERRIDE BOOTSTRAP - RÈGLES DE BASE
   ======================================== */

.btn {
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.2s ease-in-out !important;
    padding: 0.5rem 1rem !important;
}

.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
}

.btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

.btn-sm {
    padding: 0.375rem 0.875rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.375rem !important;
}

.btn-lg {
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
    border-radius: 0.625rem !important;
}

/* ========================================
   COULEURS CORPORATE PRO - VISIBLE
   ======================================== */

/* PRIMARY - Bleu professionnel fort */
.btn-primary {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(30, 64, 175, 0.4) !important;
}

.btn-primary:hover {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.5) !important;
}

/* SUCCESS - Vert forêt professionnel */
.btn-success {
    background-color: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(4, 120, 87, 0.4) !important;
}

.btn-success:hover {
    background-color: #065f46 !important;
    border-color: #065f46 !important;
    box-shadow: 0 6px 16px rgba(4, 120, 87, 0.5) !important;
}

/* DANGER - Rouge brique pro */
.btn-danger {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(185, 28, 28, 0.4) !important;
}

.btn-danger:hover {
    background-color: #991b1b !important;
    border-color: #991b1b !important;
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.5) !important;
}

/* WARNING - Orange terre cuite */
.btn-warning {
    background-color: #c2410c !important;
    border-color: #c2410c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(194, 65, 12, 0.4) !important;
}

.btn-warning:hover {
    background-color: #9a3412 !important;
    border-color: #9a3412 !important;
    box-shadow: 0 6px 16px rgba(194, 65, 12, 0.5) !important;
}

/* INFO - Cyan professionnel */
.btn-info {
    background-color: #0e7490 !important;
    border-color: #0e7490 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(14, 116, 144, 0.4) !important;
}

.btn-info:hover {
    background-color: #155e75 !important;
    border-color: #155e75 !important;
    box-shadow: 0 6px 16px rgba(14, 116, 144, 0.5) !important;
}

/* SECONDARY - Gris ardoise pro */
.btn-secondary {
    background-color: #374151 !important;
    border-color: #374151 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(55, 65, 81, 0.4) !important;
}

.btn-secondary:hover {
    background-color: #1f2937 !important;
    border-color: #1f2937 !important;
    box-shadow: 0 6px 16px rgba(55, 65, 81, 0.5) !important;
}

/* OUTLINE - Corporate */
.btn-outline-primary {
    border-color: #1e40af !important;
    color: #1e40af !important;
    border-width: 2px !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
}

.btn-outline-success {
    border-color: #047857 !important;
    color: #047857 !important;
    border-width: 2px !important;
    background-color: transparent !important;
}

.btn-outline-success:hover {
    background-color: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    border-color: #b91c1c !important;
    color: #b91c1c !important;
    border-width: 2px !important;
    background-color: transparent !important;
}

.btn-outline-danger:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.btn-outline-secondary {
    border-color: #374151 !important;
    color: #374151 !important;
    border-width: 2px !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover {
    background-color: #374151 !important;
    border-color: #374151 !important;
    color: #ffffff !important;
}
