/* ========================================
   COMPOSANTS BOUTONS - TLB Transport
   ======================================== */

/* Boutons de base */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Variantes de boutons */
.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    color: white;
    text-decoration: none;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.btn-warning:hover {
    background: #e0a800;
    color: var(--dark-color);
    text-decoration: none;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
    color: white;
    text-decoration: none;
}

/* Tailles de boutons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

/* Boutons avec icônes */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-only {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* États des boutons */
.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Boutons de navigation */
.nav-btn {
    background: #3498db;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Boutons d'action */
.action-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.action-btn.edit {
    background: #f39c12;
}

.action-btn.edit:hover {
    background: #e67e22;
}

.action-btn.save {
    background: #27ae60;
}

.action-btn.save:hover {
    background: #229954;
}

.action-btn.cancel {
    background: #e74c3c;
}

.action-btn.cancel:hover {
    background: #c0392b;
}

.action-btn.delete {
    background: #e74c3c;
}

.action-btn.delete:hover {
    background: #c0392b;
}

/* Boutons de filtres */
.filter-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #3498db;
}

.filter-btn.active:hover {
    background: #2980b9;
}

/* Boutons de mission */
.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-plan {
    background: #f39c12;
    color: white;
}

.btn-plan:hover {
    background: #e67e22;
}

.btn-view {
    background: #95a5a6;
    color: white;
}

.btn-view:hover {
    background: #7f8c8d;
}

/* Boutons de retour */
.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Boutons de fermeture (modales / popups — même style que missions) */
.close-btn,
.close-popup-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.close-btn:hover,
.close-popup-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Boutons de formulaire - alias pour uniformiser */
.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-save:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-cancel {
    background: #e74c3c;
    color: white;
}

.btn-cancel:hover {
    background: #c0392b;
    color: white;
    text-decoration: none;
}

/* Boutons d'ajout */
.add-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* Boutons de chargement */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 1.1rem;
    }
    
    .nav-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .btn-icon {
        gap: 0.25rem;
    }
    
    .btn-icon-only {
        width: 2rem;
        height: 2rem;
        padding: 0.25rem;
    }
}
