﻿/* === Shim per Bootstrap 5 su CSS Bootstrap 3 === */

/* === Spacing Utilities === */
/* Margin */
.m-0 {
    margin: 0 !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.me-0 {
    margin-right: 0 !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.ms-0 {
    margin-left: 0 !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

/* Padding */
.p-0 {
    padding: 0 !important;
}

.pt-0 {
    padding-top: 0 !important;
}

.pe-0 {
    padding-right: 0 !important;
}

.pb-0 {
    padding-bottom: 0 !important;
}

.ps-0 {
    padding-left: 0 !important;
}

/* === Display Utilities === */
.d-block {
    display: block !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-none {
    display: none !important;
}

/* === Float Utilities === */
.float-start {
    float: left !important;
}

.float-end {
    float: right !important;
}

.float-none {
    float: none !important;
}

/* === Text Utilities === */
.text-start {
    text-align: left !important;
}

.text-end {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

/* === Width Utility === */
.w-100 {
    width: 100% !important;
}

/* === Visibility === */
.visible {
    visibility: visible !important;
}

.invisible {
    visibility: hidden !important;
}

/* === Flex Utilities === */
.d-flex {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: -webkit-flex !important;
    display: flex !important;
}

.flex-column {
    -webkit-box-orient: vertical !important;
    -webkit-box-direction: normal !important;
    -webkit-flex-direction: column !important;
    -ms-flex-direction: column !important;
    flex-direction: column !important;
}

.flex-row {
    -webkit-box-orient: horizontal !important;
    -webkit-box-direction: normal !important;
    -webkit-flex-direction: row !important;
    -ms-flex-direction: row !important;
    flex-direction: row !important;
}

.justify-content-center {
    -webkit-box-pack: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
}

.align-items-center {
    -webkit-box-align: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
}

/* === Position === */
.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.position-fixed {
    position: fixed !important;
}

.position-static {
    position: static !important;
}

/* === Overflow === */
.overflow-hidden {
    overflow: hidden !important;
}

.overflow-auto {
    overflow: auto !important;
}

/* === Bootstrap 5 Modal Shim for Bootstrap 3 === */

/* Simulazione .modal-dialog-centered */
.modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

/* Assicura che il wrapper .modal usi l'intero viewport */
.modal.modal-dialog-centered {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    z-index: 1050;
    padding: 1rem;
    text-align: center;
}
    /* Hack per centrare verticalmente con display inline-block */
    .modal.modal-dialog-centered::before {
        content: "";
        display: inline-block;
        height: 100%;
        vertical-align: middle;
        margin-right: -0.05em;
    }

    /* Il contenitore della modale */
    .modal.modal-dialog-centered .modal-dialog {
        display: inline-block;
        text-align: left;
        vertical-align: middle;
        margin: 0 auto;
        width: auto;
    }

/* Simulazione .fade e .show per animazione */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
    transform: translateY(-25%);
}

.modal.fade.show .modal-dialog {
    transform: translateY(0);
}

/* Simulazione .show */
.show {
    display: block !important;
    opacity: 1 !important;
}

/* Simulazione backdrop moderno */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.15s linear;
}

/* Rimozione margine top delle modali per centrare */
.modal-dialog {
    margin: 0 auto;
}
