html, body {
    min-height:100vh; /* 1 */
	display:flex; /* 2 */
	flex-direction:column; /* 3 */
}

main {
    flex-grow: 1; /* 4 */
}

/* Shared logo hover effects */
.header-logo,
.footer-logo {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header-logo:hover,
.footer-logo:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Footer logo sizing */
.footer-logo {
    width: 150px;
    vertical-align: middle;
}

/* Theme-based logo display */
[data-bs-theme="light"] .d-light-block {
    display: inline-block !important;
}

[data-bs-theme="light"] .d-dark-block {
    display: none !important;
}

[data-bs-theme="dark"] .d-light-block {
    display: none !important;
}

[data-bs-theme="dark"] .d-dark-block {
    display: inline-block !important;
}

/* Toast Notification Styles */
#outilspratiques-toast-container {
    margin-top: 1rem;
}

/* ========== DRAG & DROP BASE STYLES ========== */
/* Styles de base pour le drag-and-drop (Dragula) - réutilisables sur toute la plateforme */

/* Drag handle - poignée de déplacement */
.drag-handle {
    cursor: grab;
    color: var(--bs-secondary-color, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Empêcher le scroll tactile sur mobile pendant le drag */
    touch-action: none;
    -webkit-touch-action: none;
}

.drag-handle:hover {
    color: var(--bs-primary, #0d6efd);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Classes Dragula - styles du framework de drag-and-drop */
.gu-mirror {
    opacity: 0.9 !important;
    cursor: grabbing !important;
    background: var(--bs-body-bg, #ffffff) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4) !important;
    transform: rotate(2deg) !important;
    z-index: 10000 !important;
    border: 2px solid var(--bs-primary, #0d6efd) !important;
    list-style: none !important;
    /* Empêcher l'interaction tactile avec le miroir */
    touch-action: none !important;
    pointer-events: none !important;
}

.gu-hide {
    opacity: 0 !important;
    visibility: hidden !important;
}

.gu-unselectable {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.gu-transit {
    opacity: 0.3 !important;
}

/* Empêcher la sélection de texte pendant le drag */
.sortable-drag-active,
.sortable-drag-active * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Animation de pulsation pour la zone de dépôt */
@keyframes pulse-gap {
    from {
        border-color: var(--bs-primary, #0d6efd);
        background: var(--bs-primary-bg-subtle, #cfe2ff);
    }
    to {
        border-color: var(--bs-success, #198754);
        background: var(--bs-success-bg-subtle, #d1e7dd);
    }
}

/* Mode sombre - ajustements pour le drag-and-drop */
[data-bs-theme="dark"] .gu-mirror {
    background: var(--bs-body-bg, #212529) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7) !important;
}

[data-bs-theme="dark"] .drag-handle {
    color: var(--bs-secondary-color, #adb5bd);
}

[data-bs-theme="dark"] .drag-handle:hover {
    color: var(--bs-primary, #6ea8fe);
}

/* Responsive - ajustements pour petits écrans */
@media (max-width: 768px) {
    .drag-handle {
        padding: 0.5rem;
    }
}

/* Accessibilité - indicateur de focus */
.drag-handle:focus-visible {
    outline: 3px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

/* Mouvement réduit - respect des préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
    .gu-mirror,
    .drag-handle {
        transition: none !important;
    }
    
    /* Désactiver l'animation de pulsation pour la zone de dépôt */
    .sortable-drag-active .gu-mirror + *::before {
        animation: none !important;
    }
}

#outilspratiques-toast-container .toast {
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid transparent;
}

/* Ensure toast is readable in both themes */
#outilspratiques-toast-container .toast .toast-header {
    border-bottom: none;
    font-weight: 600;
}

#outilspratiques-toast-container .toast .toast-body {
    font-size: 0.95rem;
    padding: 1rem;
}

/* Alert-style colors for toasts to match existing messages */
/* Success toast - green with alert-success style */
.toast.text-bg-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
}

.toast.text-bg-success .toast-header {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    border-bottom: 1px solid #badbcc;
}

.toast.text-bg-success .toast-body {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.toast.text-bg-success .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Info toast - cyan/blue with alert-info style */
.toast.text-bg-info {
    background-color: #cff4fc !important;
    border-color: #b6effb !important;
    color: #055160 !important;
}

.toast.text-bg-info .toast-header {
    background-color: #cff4fc !important;
    color: #055160 !important;
    border-bottom: 1px solid #b6effb;
}

.toast.text-bg-info .toast-body {
    background-color: #cff4fc !important;
    color: #055160 !important;
}

.toast.text-bg-info .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Warning toast - yellow with alert-warning style */
.toast.text-bg-warning {
    background-color: #fff3cd !important;
    border-color: #ffecb5 !important;
    color: #664d03 !important;
}

.toast.text-bg-warning .toast-header {
    background-color: #fff3cd !important;
    color: #664d03 !important;
    border-bottom: 1px solid #ffecb5;
}

.toast.text-bg-warning .toast-body {
    background-color: #fff3cd !important;
    color: #664d03 !important;
}

.toast.text-bg-warning .btn-close {
    filter: invert(1) grayscale(100%) brightness(50%);
}

/* Error/Danger toast - red with alert-danger style */
.toast.text-bg-danger {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #842029 !important;
}

.toast.text-bg-danger .toast-header {
    background-color: #f8d7da !important;
    color: #842029 !important;
    border-bottom: 1px solid #f5c2c7;
}

.toast.text-bg-danger .toast-body {
    background-color: #f8d7da !important;
    color: #842029 !important;
}

.toast.text-bg-danger .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dark mode adjustments for toasts */
[data-bs-theme="dark"] .toast.text-bg-success {
    background-color: #051b11 !important;
    border-color: #0f5132 !important;
    color: #75b798 !important;
}

[data-bs-theme="dark"] .toast.text-bg-success .toast-header,
[data-bs-theme="dark"] .toast.text-bg-success .toast-body {
    background-color: #051b11 !important;
    color: #75b798 !important;
}

[data-bs-theme="dark"] .toast.text-bg-info {
    background-color: #032830 !important;
    border-color: #055160 !important;
    color: #6edff6 !important;
}

[data-bs-theme="dark"] .toast.text-bg-info .toast-header,
[data-bs-theme="dark"] .toast.text-bg-info .toast-body {
    background-color: #032830 !important;
    color: #6edff6 !important;
}

[data-bs-theme="dark"] .toast.text-bg-warning {
    background-color: #332701 !important;
    border-color: #664d03 !important;
    color: #ffda6a !important;
}

[data-bs-theme="dark"] .toast.text-bg-warning .toast-header,
[data-bs-theme="dark"] .toast.text-bg-warning .toast-body {
    background-color: #332701 !important;
    color: #ffda6a !important;
}

[data-bs-theme="dark"] .toast.text-bg-danger {
    background-color: #2c0b0e !important;
    border-color: #842029 !important;
    color: #ea868f !important;
}

[data-bs-theme="dark"] .toast.text-bg-danger .toast-header,
[data-bs-theme="dark"] .toast.text-bg-danger .toast-body {
    background-color: #2c0b0e !important;
    color: #ea868f !important;
}

/* Responsive toast sizing */
@media (max-width: 576px) {
    #outilspratiques-toast-container .toast {
        min-width: 320px;
        max-width: 90vw;
    }
}

/* Toast progress bar */
#outilspratiques-toast-container .toast .toast-progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

#outilspratiques-toast-container .toast .toast-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    transition: width linear;
}

/* Progress bar colors matching alert styles */
.toast.text-bg-success .toast-progress-fill {
    background-color: #0f5132;
    opacity: 0.4;
}

.toast.text-bg-info .toast-progress-fill {
    background-color: #055160;
    opacity: 0.4;
}

.toast.text-bg-warning .toast-progress-fill {
    background-color: #664d03;
    opacity: 0.4;
}

.toast.text-bg-danger .toast-progress-fill {
    background-color: #842029;
    opacity: 0.4;
}

/* Dark mode progress bar colors */
[data-bs-theme="dark"] .toast.text-bg-success .toast-progress-fill {
    background-color: #75b798;
    opacity: 0.5;
}

[data-bs-theme="dark"] .toast.text-bg-info .toast-progress-fill {
    background-color: #6edff6;
    opacity: 0.5;
}

[data-bs-theme="dark"] .toast.text-bg-warning .toast-progress-fill {
    background-color: #ffda6a;
    opacity: 0.5;
}

[data-bs-theme="dark"] .toast.text-bg-danger .toast-progress-fill {
    background-color: #ea868f;
    opacity: 0.5;
}

/* Confirmation toast button styles */
#outilspratiques-toast-container .toast .toast-body .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid;
}

/* Buttons adapt to toast type background */
.toast.text-bg-success .toast-body .btn-light,
.toast.text-bg-info .toast-body .btn-light,
.toast.text-bg-danger .toast-body .btn-light {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
    color: #212529;
}

.toast.text-bg-warning .toast-body .btn-light {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.2);
    color: #212529;
}

#outilspratiques-toast-container .toast .toast-body .btn-light:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.3);
}

#outilspratiques-toast-container .toast .toast-body .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

#outilspratiques-toast-container .toast .toast-body .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Dark mode button adjustments */
[data-bs-theme="dark"] .toast .toast-body .btn-light {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    color: inherit;
}

[data-bs-theme="dark"] .toast .toast-body .btn-light:hover {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}


