/**
 * Stili personalizzati per l'applicazione Gestione Turni Hospice
 */

/* Dimensioni generali e colori */
:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    padding-bottom: 60px;
    min-height: 100vh;
}

/* Stili per la dashboard */
.stats-card {
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Stili per i turni */
.turno-cell {
    position: relative;
    height: 40px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.turno-cell:hover {
    border-color: #aaa;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.turno-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-weight: bold;
    border-radius: 3px;
}

.turno-badge.weekend {
    font-style: italic;
}

.turno-info {
    position: absolute;
    width: 250px;
    padding: 10px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.turno-cell:hover .turno-info {
    display: block;
}

/* Stili per le tabelle */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Evidenziazione giorni weekend */
.weekend {
    background-color: rgba(0, 0, 0, 0.03);
}

.table-turni th.weekend {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Calendario turni */
.calendar-container {
    position: relative;
    overflow-x: auto;
}

.calendar-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: white;
}

.calendar-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
}

.calendar-cell {
    flex: 1;
    min-width: 40px;
    padding: 4px;
    text-align: center;
    border-right: 1px solid #e9ecef;
}

.calendar-cell.operatore {
    min-width: 150px;
    text-align: left;
    font-weight: bold;
    background-color: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Stile per tabella turni con intestazioni ripetute */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: white;
}

.sticky-categoria {
    position: sticky;
    top: 42px; /* Altezza dell'header principale */
    z-index: 2;
}

/* Per migliorare visibilità bordi e allineamento */
.table-bordered th {
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

/* Stile per evidenziare la cella selezionata */
.turno-cell:hover {
    background-color: rgba(0,123,255,0.1) !important;
}

/* Modali */
.modal-turno .modal-header {
    padding: 10px 15px;
}

.modal-turno .modal-footer {
    padding: 10px 15px;
}

/* Form e input */
.form-turno .form-group {
    margin-bottom: 1rem;
}

.form-turno label {
    font-weight: 500;
}

/* Tooltip personalizzato */
.tooltip-turno {
    position: absolute;
    z-index: 1070;
    display: block;
    margin: 0;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    word-spacing: normal;
    white-space: normal;
    line-break: auto;
    font-size: 0.875rem;
    word-wrap: break-word;
    opacity: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    transition: opacity 0.15s linear;
}

.tooltip-turno.show {
    opacity: 1;
}

/* Login page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 400px;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Stampa */
@media print {
    .no-print {
        display: none !important;
    }
    
    .table-print {
        width: 100%;
        border-collapse: collapse;
    }
    
    .table-print th,
    .table-print td {
        border: 1px solid #000;
        padding: 5px;
        text-align: center;
    }
    
    body {
        padding: 0;
        margin: 0;
    }
    
    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
}

/* Aggiunti stili per i conflitti */
.conflitto-turno {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
}

/* Stili specifici per la pagina dei conflitti */

/* Stile per le righe con conflitti */
.table-danger {
    transition: background-color 0.3s ease;
}

.table-danger:hover {
    background-color: #f8d7da;
}

/* Stile per i badge dei turni */
.badge {
    display: inline-block;
    min-width: 30px;
    padding: 5px 8px;
    font-weight: bold;
    text-align: center;
}

/* Stile per i bottoni di azione sui conflitti */
.btn-group-sm > .btn {
    margin-right: 2px;
}

/* Stile per evidenziare un conflitto specifico */
.highlight-conflitto {
    position: relative;
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Animazione per l'evidenziazione */
@keyframes highlight-pulse {
    0% { background-color: #ffeeee; }
    50% { background-color: #ffcccc; }
    100% { background-color: #ffeeee; }
}

/* Aggiunta di stili per i tipi di conflitto */
.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

/* Miglioramento dell'aspetto delle card informative */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-bottom: 20px;
}

.card-header {
    font-weight: 500;
}

/* Stile per il banner informativo */
.alert-info {
    border-left: 4px solid #17a2b8;
}

.alert-success {
    border-left: 4px solid #28a745;
}

.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert-danger {
    border-left: 4px solid #dc3545;
}

/* Stili responsive per i dispositivi mobili */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calendar-cell {
        min-width: 35px;
        padding: 2px;
        font-size: 0.8rem;
    }
    
    .calendar-cell.operatore {
        min-width: 120px;
        font-size: 0.8rem;
    }
    
    .turno-cell {
        height: 35px;
    }
}
