/* ===== GLOBALI & VARIABILI ===== */
:root {
    --uisp-green-dark: #1b4332;
    --uisp-green-dark-rgb: 27, 67, 50;
    --uisp-green-mid: #2d6a4f;
    --uisp-green-mid-rgb: 45, 106, 79;
    --uisp-success: #198754;
    --uisp-success-rgb: 25, 135, 84;
    --uisp-green-accent: #74c69d;
    --uisp-green-accent-rgb: 116, 198, 157;
    --uisp-green-soft: #f0fdf4;
    --uisp-green-soft-rgb: 240, 253, 244;
    --sidebar-desktop-width: 280px;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: .9rem;
    background-color: var(--uisp-green-soft);
    color: #2d3436;
    overflow-x: hidden;
}

/* ===== NAVBAR (header) ===== */
.navbar {
    background-color: var(--uisp-green-dark) !important;
    z-index: 1060;
}
.navbar-brand {
    font-weight: 700;
    color: #fff !important;
}
.user-dropdown .dropdown-toggle {
    background: rgba(var(--uisp-success-rgb), 0.5);
    /* border-radius: 50px; */
    padding: 5px 15px;
    /* border: 1px solid rgba(255,255,255,0.2); */
    border: 1px solid rgba(var(--uisp-success-rgb),0.5);
    color: white !important;
}

.user-dropdown .dropdown-toggle:hover {
    background: rgba(var(--uisp-success-rgb), 1);
}

#sidebarToggle {
    border: none;
    background: transparent;
    color: white;
    font-size: 1.5rem;
}

/* ===== SIDEBAR ===== */
#sidebarWrapper {
    display: flex;
    min-height: calc(100vh - 56px);
}
#sidebar {
    width: var(--sidebar-desktop-width);
    background: white;
    border-right: 1px solid #dee2e6;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s ease, margin-left 0.3s ease;
    z-index: 1050;
}
/* Mobile (max 767px) */
@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 10px 0 15px rgba(0,0,0,0.1);
    }
    #sidebarWrapper.mobile-open #sidebar {
        transform: translateX(0);
    }
    .resizer { display: none; }
    #sidebarWrapper.mobile-open::after {
        content: "";
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 1040;
    }
}
/* Desktop (min 768px) */
@media (min-width: 768px) {
    #sidebarWrapper.collapsed #sidebar {
        margin-left: calc(var(--sidebar-desktop-width) * -1);
    }
}
/* Elementi interni sidebar */
.resizer {
    width: 4px;
    cursor: col-resize;
    position: absolute;
    right: 0; top: 0; bottom: 0;
    background: transparent;
}
.resizer:hover { background: var(--uisp-green-accent); }
.nav-link {
    color: var(--uisp-green-dark);
    font-weight: 500;
    padding: 12px 20px;
    margin: 4px 10px;
    border-radius: 8px;
}
.nav-link:hover { background: var(--uisp-green-soft); }
.nav-link.active {
    background: var(--uisp-green-mid);
    color: white !important;
}

/* ===== MAIN CONTENT ===== */
#content {
    flex-grow: 1;
    padding: 1.5rem;
    transition: all 0.3s;
}

/* Header gara (stile deep_d) */
.race-header {
    background: transparent;
    padding: 0 0 1rem 0;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--uisp-green-accent);
}
.race-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--uisp-green-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.race-header .badge,
.modal-header .badge{
    background: var(--uisp-green-accent);
    color: var(--uisp-green-dark);
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-weight: 500;
}
.race-header .action-icons {
    display: flex;
    gap: 0.5rem;
}
.race-header .action-icons a {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    /* background: var(--uisp-green-soft); */
    background-color:  rgba(0, 128, 0, 0.1);
    color: var(--uisp-green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.race-header .action-icons a:hover {
    background: var(--uisp-green-mid);
    color: white;
}

/* Dettaglio gara (card) */
.detail-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 2rem;
}
.detail-card .card-body {
    padding: 1.5rem;
    background-color: white;
}

/* Righe di dettaglio informazioni */
.info-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e9ecef;
}
.info-row:last-child { border-bottom: none; }
.info-label {
    width: 40%; /*140px;*/
    font-weight: 500;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.info-value {
    flex: 1;
    font-weight: 600;
    color: #212529;
}
@media (max-width: 576px) {
    .info-row {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.8rem 0;
    }
    .info-label { width: auto; }
}

/* Card per le sezioni (Classifiche, Iscrizioni) */
.section-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    background: white;
}
.section-card .card-header {
    background: white;
    border-bottom: 2px solid var(--uisp-green-soft);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.section-card .card-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--uisp-green-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-card .card-header .btn-primary {
    background: var(--uisp-green-success);
    border: none;
    padding: 0.5rem 1.2rem;
    /*border-radius: 50px;*/
    font-weight: 500;
    transition: all 0.2s;
}
.section-card .card-header .btn-primary:hover {
    background: var(--uisp-green-mid)!important;
    /* transform: scale(1.02); */
}
.section-card .card-body { padding: 1.5rem; }

/* ===== TABELLE DataTables ===== */
.dataTables_wrapper { font-size: 0.9rem; }
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 8px;
    margin-top: 0 !important;
    width: 100% !important;
}
table.dataTable thead th {
    background: var(--uisp-green-soft);
    color: var(--uisp-green-dark);
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    white-space: nowrap;
}
table.dataTable tbody tr {
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    border-radius: 12px;
    transition: box-shadow 0.2s;
}
/* Righe alternate */
table.dataTable tbody tr.even {
    background: #f8f9fa;
}
table.dataTable tbody tr:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
table.dataTable tbody td {
    padding: 1rem 0.75rem;
    border: none;
    vertical-align: middle;
}
table.dataTable tbody td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
table.dataTable tbody td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.page-link {
    color: var(--uisp-green-dark);
}

/* Pulsanti azioni nelle tabelle */
.mbListActions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.mbListActions .btn,
.mbListActions a {
    background-color:  rgba(var(--uisp-success-rgb), 0.1)!important;
    color: var(--uisp-green-dark);
    border: none;
    /* border-radius: 30px; */
    border-radius: 8px;
    padding: 0.3rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: 30px;
    height: 30px;
    justify-content: center;
}

.mbListActions .btn.btn-primary,
.mbListActions a.btn-primary {
    background-color: rgba(var(--uisp-success-rgb), 1) !important;
    color: white;
    width: auto;
    height: auto;
}


.mbListActions .btn:hover,
.mbListActions a:hover {
    /* background: var(--uisp-green-mid); */
    background-color:  rgba(var(--uisp-success-rgb), 1)!important;
    color: white;
}

.mbListActions .btn.btn-primary:hover,
.mbListActions a.btn-primary:hover {
    background-color: rgba(var(--uisp-green-dark-rgb), 1) !important;
    color: white;
}



/* .mbListActions i { font-size: 1rem; } */

/* Evidenza certificato scaduto */
.medicalCertificateExpiredForRegistration {
    background-color: #fff3f0 !important;
}
.medicalCertificateExpiredForRegistration i.bi-exclamation-triangle {
    color: #dc3545;
    font-size: 1.1rem;
}










/* === ulteriori personalizzazioni === */
.modal {
    z-index: 1070;
}

/* === link === */

a {
    color: rgba(var(--uisp-success-rgb), 1);
}

/* === buttons === */

.action-icons a{
    /* border:  1px solid rgba(0, 128, 0, 0.4); */
    background-color:  rgba(var(--uisp-success-rgb), 0.1)!important;
    cursor: pointer;
}

.action-icons a:hover {
    background-color: var(--uisp-green-mid)!important;
}

.accordion-button {
  background-color: rgba(var(--uisp-success-rgb), 0.3) !important;
  border: 1px solid rgba(var(--uisp-success-rgb), 0.5) !important;
}

.accordion-button:focus {
  box-shadow: none !important;
  outline: 0; /* rimuove anche l'outline di default (non sempre presente) */
}

/* data tables | bottone pagine*/
.active>.page-link, .page-link.active  {
    background-color: rgb(108, 117, 125);
}

/* data tables | spinner */

div.dataTables_processing>div:last-child>div {
    background-color: rgba(var(--uisp-success-rgb), 0.8) !important;
}

/* data tables | barra di scorrimento orrizzontale */

/* ... Permette a #content di restringersi sotto la larghezza della tabella */
#content {
    min-width: 0;
}

/* ... Abilita lo scroll orizzontale sul contenitore della tabella */
.card-body.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Il margine ora viene aggiunto solo con la classe .has-overflow */
}

/* Margine destro solo quando c'è overflow */
.card-body.table-responsive.has-overflow {
    margin-right: 1.5rem;
}

/* Impedisce alle celle di andare a capo */
.card-body.table-responsive table.dataTable td,
.card-body.table-responsive table.dataTable th {
    white-space: nowrap;
}



/* === colore btn primary === */

.btn-primary {
    background-color: rgba(var(--uisp-success-rgb), 1)!important;
    border: none;
}

.text-bg-primary {
    background-color: rgba(var(--uisp-success-rgb), 1) !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: var(--uisp-green-mid)!important;
}

/* === filtri === */

.mb_crud_list_filters {
    min-height: 106px; /* testato in eventi aperti da utente normale  in championship 146px; */
}



/* === ombra sul fuoco degli input === */

.form-control:focus,
.form-select:focus {
    border-color: var(--uisp-green-accent);
    box-shadow: 0 0 0 0.25rem rgba(var(--uisp-green-accent-rgb), 0.25);
    outline: 0;
}

/** === modal === */

/* header e footer del colore uisp-green-accent al 0.25 */
.modal-header, .modal-footer {
    background-color: rgba(var(--uisp-green-accent-rgb), 0.25) !important;
}

.modal-header h5 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--uisp-green-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mb_formUid {
    height: 0px;
    overflow: hidden;
    margin-bottom: 0!important;
}


/* === */

.nav-item.mbAdmin {
    background-color: lightgreen;
} 

/* === MyChampionshipsByRegionFilters === */

.mb_crud_list_MyChampionshipsByRegion .mb_crud_list_filters{
    min-height: auto;
}

.mb_crud_list_MyChampionshipsByRegion .btn-outline-primary {
    background-color: rgba(var(--uisp-success-rgb), 0.1) !important;
    border-color: rgba(var(--uisp-success-rgb), 0.5) !important;
    color: var(--uisp-green-dark) !important;
}

.mb_crud_list_MyChampionshipsByRegion .btn-outline-primary:hover {
    background-color: rgba(var(--uisp-success-rgb), 1) !important;
    border-color: rgba(var(--uisp-success-rgb), 1) !important;
    color: white !important;
}

/* FROM GLOBAL.CSS */

header {
    position: fixed;
    width: 100%
}

h1{
    margin-top: 30px;
    margin-bottom: 30px;
}

.sidebar a.open{
    font-weight: bold;
    color: blue;
}

.mb_body {
    margin-bottom: 30px;
    margin-top: 30px;
}