/* Stili generali */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Login Page */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-card {
    border: none;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    background: rgb(255, 255, 255);
}

.login-logo {
    max-height: 80px;
}

/* Sidebar */
.sidebar {
    background-color: white;
    border-right: 1px solid #dee2e6;
    min-height: calc(100vh - 76px);
    padding: 0;
}

.sidebar .list-group-item {
    border: none;
    border-radius: 0;
    padding: 15px 20px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Main Content */
.main-content {
    padding: 20px;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Tables */
.table th {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

/* Calendar */
.calendar-day {
    border: 1px solid #dee2e6;
    padding: 10px;
    height: 120px;
    background-color: white;
    transition: background-color 0.3s ease;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.today {
    background-color: #e3f2fd;
    border: 2px solid var(--secondary-color);
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Status Colors */
.status-free {
    background-color: #d4edda;
    color: #155724;
}

.status-occupied {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .main-content {
        padding: 10px;
    }

    .calendar-day {
        height: 80px;
        padding: 5px;
        font-size: 0.8rem;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Styles */
.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Card Volontari */
.volontario-card {
    transition: all 0.3s ease;
    border-left: 4px solid var(--secondary-color);
}

.volontario-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Badge Fasce */
.fascia-badge {
    font-size: 0.75rem;
    margin: 2px;
}

/* Container Disponibilità */
.disponibilita-container {
    max-height: 150px;
    overflow-y: auto;
}

/* Stati Vuoti */
.empty-state {
    color: #6c757d;
    font-style: italic;
}

/* Pulsanti View Mode */
.view-mode-btn.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.view-mode-btn:not(.active) {
    background-color: white;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.view-mode-btn:not(.active):hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Card Statistiche */
.stats-card {
    border: none;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
}

/* Tabelle Compatte */
.table-sm th,
.table-sm td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Badge Compatti per Fasce */
.badge-fascia-compact {
    font-size: 0.7rem;
    padding: 0.25em 0.4em;
    margin: 1px;
}

/* Griglia Responsiva */
.volontari-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .volontari-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Dettagli */
.modal-details-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.details-stats {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

/* Scrollbar Personalizzata */
.disponibilita-container::-webkit-scrollbar {
    width: 6px;
}

.disponibilita-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.disponibilita-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.disponibilita-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Badge Colori per Giorni */
.badge-lunedi {
    background-color: #007bff;
}

.badge-martedi {
    background-color: #28a745;
}

.badge-mercoledi {
    background-color: #17a2b8;
}

.badge-giovedi {
    background-color: #ffc107;
    color: #000;
}

.badge-venerdi {
    background-color: #dc3545;
}

.badge-sabato {
    background-color: #6c757d;
}

.badge-domenica {
    background-color: #343a40;
}

/* Hover Effects */
.card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Loading States Eleganti */
.loading-state {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.loading-active {
    position: relative;
}

.loading-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsanti con loading */
.btn-loading {
    position: relative;
    color: transparent !important;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    margin-bottom: 12px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Stili per gestione sospensioni */
.sospensione-item {
    border-left: 4px solid var(--warning-color);
    transition: all 0.3s ease;
}

.sospensione-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sospensione-item.approvata {
    border-left-color: var(--success-color);
}

.sospensione-item.rifiutata {
    border-left-color: var(--danger-color);
}

/* Badge stati sospensione */
.badge-sospensione {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Stili per azioni sospensioni */
.sospensione-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sospensione-action {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Stati sospensioni */
.sospensione-revoked {
    opacity: 0.6;
    background-color: #fff3cd;
}

.sospensione-deleted {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Badge stati aggiuntivi */
.badge-revocata {
    background-color: var(--warning-color);
}

.badge-eliminata {
    background-color: var(--danger-color);
}

/* Modal azioni sospensioni */
.modal-sospensione-actions .list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

.modal-sospensione-actions .list-group-item:last-child {
    border-bottom: none;
}

/* Responsive per azioni */
@media (max-width: 768px) {
    .sospensione-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-sospensione-action {
        width: 100%;
        justify-content: center;
    }
}

/* Animazioni per azioni */
.sospensione-updating {
    position: relative;
}

.sospensione-updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

/* Stili per contatori */
.counter-badge {
    font-size: 0.7rem;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Stili per stati temporali */
.sospensione-futura {
    border-left: 4px solid #17a2b8;
}

.sospensione-passata {
    opacity: 0.7;
    background-color: #f8f9fa;
}

.sospensione-scaduta {
    text-decoration: line-through;
    color: #6c757d;
}

/* Card stati sospensione */
.card-sospensione-attiva {
    border-left: 4px solid var(--info-color);
}

.card-sospensione-attiva .card-header {
    background-color: var(--info-color) !important;
}

.card-sospensione-in-attesa {
    border-left: 4px solid var(--warning-color);
}

.card-sospensione-in-attesa .card-header {
    background-color: var(--warning-color) !important;
}

.card-sospensione-storico {
    border-left: 4px solid var(--secondary-color);
}

.card-sospensione-storico .card-header {
    background-color: var(--secondary-color) !important;
}

/* Tabelle compatte per sospensioni */
.table-sospensioni th {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem;
}

.table-sospensioni td {
    font-size: 0.875rem;
    padding: 0.5rem;
    vertical-align: middle;
}

/* Responsive per sospensioni */
@media (max-width: 768px) {
    .sospensione-item {
        margin-bottom: 1rem;
    }

    .sospensione-item .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .table-sospensioni {
        font-size: 0.8rem;
    }
}

/* Animazioni per aggiornamenti sospensioni */
.sospensione-updated {
    animation: highlightUpdate 2s ease;
}

@keyframes highlightUpdate {
    0% {
        background-color: rgba(40, 167, 69, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

/* Stili per form sospensioni */
#data_fine_field {
    transition: all 0.3s ease;
}

.form-sospensione .form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Loading per gestione sospensioni */
.sospensione-loading {
    opacity: 0.6;
    pointer-events: none;
}

.sospensione-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stili per sospensioni annullabili */
.sospensione-cancellable {
    border-left: 4px solid var(--warning-color);
    background-color: #fff3cd;
}

.sospensione-active {
    border-left: 4px solid var(--danger-color);
    background-color: #f8d7da;
}

.sospensione-future {
    border-left: 4px solid var(--info-color);
    background-color: #d1ecf1;
}

/* Pulsanti annullamento */
.btn-cancel-suspension {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.btn-cancel-suspension:hover {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

/* Stati temporali */
.status-in-corso {
    color: var(--danger-color);
    font-weight: bold;
}

.status-programmata {
    color: var(--info-color);
    font-weight: bold;
}

.status-terminata {
    color: var(--secondary-color);
    opacity: 0.7;
}

/* Badge stati */
.badge-annullata {
    background-color: #6c757d;
}

.badge-revocata {
    background-color: var(--warning-color);
}

/* Animazioni per annullamento */
.sospensione-cancelling {
    animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

/* Tooltip personalizzati */
.tooltip-cancellable .tooltip-inner {
    background-color: var(--warning-color);
    color: black;
}

.tooltip-cancellable .tooltip-arrow {
    border-top-color: var(--warning-color);
}

/* Responsive per azioni multiple */
@media (max-width: 576px) {
    .sospensione-actions-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .sospensione-actions-mobile .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Stili per comunicazioni */
.preview-email {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.preview-body {
    white-space: pre-wrap;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

/* Contatori caratteri */
.form-text .text-danger {
    font-weight: bold;
}

/* Loading per invio email */
.btn-loading {
    position: relative;
    pointer-events: none;
}

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

/* ===== CALENDARIO VERTICALE ===== */
.vertical-calendar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 800px;
    overflow-y: auto;
    padding: 5px;
}

.calendar-day-vertical {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-day-vertical:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-day-vertical.today {
    background: #e8f4fc !important;
    border: 2px solid #3498db !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    position: relative;
}

.calendar-day-vertical.today::before {
    content: "Oggi";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 1;
}

.day-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.day-number {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.day-name {
    font-weight: 600;
    color: #495057;
}

.month-name {
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
}

.turni-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.turno-item-vertical {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.turno-item-vertical:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.turno-item-vertical.status-free {
    background-color: #d4edda;
    border-left-color: #28a745;
}

.turno-item-vertical.status-occupied {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.turno-item-vertical.status-pending {
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

.turno-info {
    flex: 1;
}

.turno-time-badge {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.tipo-turno {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.fascia-oraria {
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.turno-person,
.turno-ruolo,
.turno-libero {
    font-size: 0.9rem;
    margin-bottom: 3px;
    color: #495057;
}

.turno-libero {
    color: #6c757d;
    font-style: italic;
}

.turno-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.empty-day {
    font-style: italic;
    color: #adb5bd;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Navigazione calendario */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-arrow {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: scale(1.1);
}

.calendar-nav-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 250px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Calendario orizzontale (per toggle) */
.calendar-orizzontale {
    display: none;
}

/* Vista a tabella per dispositivi piccoli */
@media (max-width: 768px) {
    .vertical-calendar {
        gap: 10px;
        max-height: none;
        overflow-y: visible;
    }

    .calendar-day-vertical {
        padding: 12px;
    }

    .turno-item-vertical {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .turno-actions {
        justify-content: flex-end;
    }

    .calendar-nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .calendar-nav-title {
        font-size: 1.2rem;
        min-width: auto;
        order: -1;
    }

    .nav-arrow {
        width: 100%;
        justify-content: center;
    }

    .day-number {
        font-size: 1.3rem;
    }

    .day-name {
        font-size: 0.9rem;
    }
}

/* Scrollbar personalizzata per calendario verticale */
.vertical-calendar::-webkit-scrollbar {
    width: 8px;
}

.vertical-calendar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.vertical-calendar::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.vertical-calendar::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Animazioni */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-day-vertical {
    animation: slideIn 0.3s ease-out;
}

.calendar-day-vertical:nth-child(even) {
    animation-delay: 0.1s;
}

.calendar-day-vertical:nth-child(3n) {
    animation-delay: 0.2s;
}

/* ===== CALENDARIO VERTICALE COLLASSABILE ===== */
.vertical-calendar-collapsable {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-day-collapsable {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.calendar-day-collapsable.today {
    border: 2px solid var(--secondary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.calendar-day-collapsable.today .day-header-collapsable {
    background: linear-gradient(135deg, #e8f4fc 0%, #d4eaff 100%);
}

.day-header-collapsable {
    padding: 15px 20px;
    cursor: pointer;
    background: #f8f9fa;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.calendar-day-collapsable.expanded .day-header-collapsable {
    border-bottom-color: #dee2e6;
    background: white;
}

.day-header-collapsable:hover {
    background: #f0f7ff;
}

.day-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.day-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.day-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.day-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.day-stats {
    display: flex;
    gap: 5px;
}

.turni-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.turno-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.turno-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.turno-completo {
    background: var(--success-color);
    color: white;
    border: 1px solid #28a745;
}

.turno-parziale {
    background: var(--warning-color);
    color: #212529;
    border: 1px solid #ffc107;
}

.turno-vuoto {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.day-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-icon {
    color: var(--secondary-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.calendar-day-collapsable.expanded .toggle-icon {
    transform: rotate(180deg);
}

.day-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background: white;
}

.turni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

.turno-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.turno-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.turno-card.completo {
    border-left: 4px solid var(--success-color);
}

.turno-card.parziale {
    border-left: 4px solid var(--warning-color);
}

.turno-card.vuoto {
    border-left: 4px solid #6c757d;
}

.turno-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.turno-tipo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tipo-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.9rem;
}

.fascia-badge {
    background: var(--secondary-color);
    color: white;
    font-size: 0.8rem;
}

.turno-status .status-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.completo {
    background: #d4edda;
    color: #155724;
}

.status-badge.parziale {
    background: #fff3cd;
    color: #856404;
}

.status-badge.vuoto {
    background: #f8f9fa;
    color: #6c757d;
}

.turno-body {
    margin-bottom: 15px;
}

.volontario-assignato {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.volontario-assignato i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.volontario-nome {
    font-weight: 600;
    color: var(--primary-color);
}

.volontario-ruolo {
    font-size: 0.85rem;
    color: #6c757d;
}

.turno-libero {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-style: italic;
    padding: 8px 0;
}

.turno-note {
    display: flex;
    align-items: start;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #495057;
}

.turno-note i {
    color: #6c757d;
    margin-top: 2px;
}

.turno-footer {
    margin-top: 15px;
}

.empty-turni {
    grid-column: 1 / -1;
}

/* LEGENDA */
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* STATISTICHE */
.stats-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
}

.stat-item {
    padding: 15px 0;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* MODALE DETTAGLI TURNO */
.modal-details-body {
    max-height: 60vh;
    overflow-y: auto;
}

.turno-details-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

.turno-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--secondary-color);
}

.detail-card h6 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.volontari-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.volontario-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.volontario-item i {
    color: var(--secondary-color);
}

.volontario-info {
    flex: 1;
}

.volontario-qualifica {
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
}

/* NAVIGAZIONE STILIZZATA */
.nav-month {
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.nav-month:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* FILTRI AVANZATI */
.filter-card .card-header {
    border-radius: 8px 8px 0 0;
}

.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .calendar-day-collapsable {
        margin-bottom: 10px;
    }

    .day-header-collapsable {
        padding: 12px 15px;
    }

    .day-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .turni-preview {
        margin-top: 10px;
        margin-left: 0;
    }

    .turni-grid {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 10px;
    }

    .nav-month {
        min-width: auto;
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .calendar-nav-title {
        font-size: 1.2rem;
        min-width: auto;
        padding: 0 10px;
    }

    .legend-item {
        margin-bottom: 5px;
    }

    .turno-badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

@media (max-width: 576px) {
    .turni-preview {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .day-stats {
        flex-wrap: wrap;
    }

    .turno-card {
        padding: 12px;
    }

    .stat-item {
        margin-bottom: 15px;
    }
}

/* ANIMAZIONI */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-day-collapsable {
    animation: fadeIn 0.3s ease-out;
}

.turno-card {
    animation: fadeIn 0.4s ease-out;
}

/* TOOLTIP PERSONALIZZATO */
.tooltip-custom {
    --bs-tooltip-bg: var(--primary-color);
    --bs-tooltip-color: white;
}

/* SCROLLBAR PERSONALIZZATA */
.modal-details-body::-webkit-scrollbar {
    width: 8px;
}

.modal-details-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-details-body::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.modal-details-body::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}
/* STATS CARDS PREMIUM */
.stats-card-premium {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
    min-height: 100px;
}

.stats-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stats-card-premium .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stats-card-premium h4 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -1px;
}

.stats-card-premium p {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.stats-card-premium i.stats-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.15;
    transform: rotate(-15deg);
}

/* Gradients */
.bg-gradient-primary-card {
    background: linear-gradient(45deg, #2c3e50, #4ca1af);
}

.bg-gradient-success-card {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
}

.bg-gradient-info-card {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.bg-gradient-warning-card {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.bg-gradient-danger-card {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.bg-gradient-purple-card {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
}
/* Stili per Visualizzazione Ruoli Scoperti */
.uncovered-day-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.uncovered-day-title {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.uncovered-role-card {
    background: #fff;
    border-left: 4px solid var(--danger-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
}

.uncovered-role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-left-width: 6px;
}

.bg-primary-subtle {
    background-color: rgba(52, 152, 219, 0.1);
}

.border-primary-subtle {
    border-color: rgba(52, 152, 219, 0.2) !important;
}

#uncovered-view-container {
    min-height: 400px;
}

/* Animazione Tab Switch */
.view-pane {
    display: none;
}

.view-pane.active {
    display: block;
}
