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

/* Badge arancione per sintomi */
.badge-arancione {
    background-color: #ff8c00 !important;
    color: white !important;
}

/* Stile per celle weekend nei turni - solo per intestazioni */
.weekend-cell th {
    background-color: #e8e8e8 !important;
    font-weight: bold !important;
}

/* Weekend con turni mantengono il colore del turno */
.weekend-cell td {
    border: 2px solid #d0d0d0 !important;
}

/* Intestazione fissa per calendario turni */
.sticky-header th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Quadratini per totali turni */
.shift-total-square {
    display: inline-block;
    width: 24px;
    height: 24px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 24px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Fix per i modal che appaiono sotto la navbar */
.modal-backdrop {
    z-index: 1040 !important;
}
.modal {
    z-index: 1050 !important;
}
.modal-dialog {
    margin-top: 80px !important; /* Distanza extra dalla navbar */
}

/* Stile per la pagina di login */
.login-page {
    background-image: url('../images/medical-background.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: 1;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.login-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-top: 4px solid #007bff;
}

/* Stile per la navbar */
.navbar {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    padding: 0.5rem 1rem;
}

/* Stile per le icone mobili sulla navbar */
.navbar-icons-mobile {
    display: flex;
    align-items: center;
}

.navbar-icons-mobile .nav-link {
    padding: 0.5rem 0.5rem;
    font-size: 1.1rem;
}

/* Nascondi le icone mobili su desktop */
@media (min-width: 992px) {
    .navbar-icons-mobile {
        display: none;
    }
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    position: absolute;
    z-index: 1050;
}

.navbar .nav-item .nav-link {
    padding: 0.8rem 1rem;
    position: relative;
}

.navbar .nav-item .nav-link:hover,
.navbar .nav-item .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar .nav-item .nav-link i {
    margin-right: 0.4rem;
}

/* Stile per il menu esteso */
.extended-menu {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1020;
    width: 100%;
    overflow-x: hidden;
}

/* Stili per il nuovo menu dropdown personalizzato */
.dropdown-container {
    position: relative;
    margin: 0.5rem;
}

.dropdown-header {
    display: flex;
    align-items: center;
}

.dropdown-header .btn {
    border-radius: 30px 0 0 30px !important;
    margin-right: 0 !important;
}

.toggle-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 30px 30px 0 !important;
    border: none;
    margin-left: -1px;
    color: white;
}

.btn-dark.toggle-btn {
    background-color: #343a40;
}

.btn-warning.toggle-btn {
    background-color: #f6c23e;
    color: #333;
}

.btn-primary.toggle-btn {
    background-color: #4e73df;
}

.btn-info.toggle-btn {
    background-color: #36b9cc;
}

.btn-success.toggle-btn {
    background-color: #1cc88a;
}

.btn-secondary.toggle-btn {
    background-color: #858796;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 250px;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    margin-top: 5px;
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: auto;
}

/* Stile predefinito per il dropdown quando mostrato */
.dropdown-content.show {
    display: block;
}

/* Stile per i pulsanti del menu */
.menu-btn {
    border-radius: 30px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 900;
}

/* Modifica per dispositivi mobili */
@media (max-width: 992px) {
    .menu-btn {
        padding: 0.2rem !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
        border-radius: 50% !important;
        min-width: unset !important;
        margin: 0 0.2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Nascondi il testo nei pulsanti - mostra solo le icone */
    .menu-btn .btn-text {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .menu-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
    
    .menu-btn i {
        margin-right: 0 !important;
    }
    
    .menu-btn .btn-text {
        display: none !important;
    }
    
    .menu-container {
        justify-content: center !important;
    }
}

@media (max-width: 768px) {
    .menu-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
        margin: 0 !important;
    }
    
    .dropdown-container {
        position: relative !important;
        margin: 0 0.1rem !important;
    }
    
    /* Menu a tendina su mobile */
    .dropdown-content {
        position: fixed !important;
        top: 80px !important; /* Posiziona nella parte alta dello schermo */
        left: 5% !important;
        width: 90% !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        background-color: white !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
        z-index: 9999999 !important;
    }
    
    /* Pulsante di chiusura per menu mobile */
    .dropdown-content::before {
        content: "×" !important;
        position: absolute !important;
        right: 10px !important;
        top: 5px !important;
        font-size: 24px !important;
        font-weight: bold !important;
        cursor: pointer !important;
        color: #555 !important;
    }
    
    .extended-menu .row {
        flex-wrap: nowrap !important;
        overflow-x: hidden !important; /* Nasconde la barra di scorrimento */
        justify-content: center !important;
        padding: 0.25rem !important;
        gap: 0.2rem !important;
        flex-shrink: 0 !important;
    }
    
    /* Riduci lo spazio verticale */
    .extended-menu-mobile {
        padding: 0.2rem 0 !important;
        overflow-x: hidden !important;
    }
    
    .col-auto {
        padding: 0 0.1rem !important;
        flex-shrink: 0 !important;
    }
}

.dropdown-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-content li {
    padding: 0;
}

.dropdown-content a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(0, 123, 255, 0.08);
}

.dropdown-content hr {
    margin: 0.5rem 0;
    border-color: #eee;
}

.dropdown-category {
    margin: 0.5rem;
}

.dropdown-category .btn {
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
}

.dropdown-category .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dropdown-category .dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    min-width: 240px;
    position: absolute !important;
    z-index: 9999 !important;
    display: none;
}

.dropdown-category .dropdown-item {
    padding: 0.6rem 1.5rem;
    transition: all 0.2s;
}

.dropdown-category .dropdown-item:hover {
    background-color: rgba(0, 123, 255, 0.08);
}

.dropdown-category .dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Colori specifici per i pulsanti */
.dropdown-category .btn-primary {
    background-color: #4e73df;
}

.dropdown-category .btn-success {
    background-color: #1cc88a;
}

.dropdown-category .btn-info {
    background-color: #36b9cc;
    color: white;
}

.dropdown-category .btn-warning {
    background-color: #f6c23e;
    color: #333;
}

.dropdown-category .btn-secondary {
    background-color: #858796;
}

@media (max-width: 992px) {
    .extended-menu .row {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0.5rem;
    }
    
    .dropdown-category {
        margin: 0 0.25rem;
    }
    
    .dropdown-category .btn {
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown-category .btn i {
        margin: 0;
    }
    
    .dropdown-category .btn .btn-text {
        display: none;
    }
}

/* Stile per il contenuto principale */
main {
    padding: 1.5rem;
}

/* Stile per le schede della dashboard */
.dashboard-stats {
    margin-top: 1rem;
}

.stat-card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    color: #007bff;
}

.icon-container {
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(0,0,0,.05);
}

/* Stile per le tabelle */
.table-container {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Stile per i pulsanti e le azioni */
.btn-action {
    margin-right: 5px;
}

/* Stile per i form */
.form-container {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-title {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

/* Stile per i profili */
.profile-card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-right: 1.5rem;
    object-fit: cover;
}

/* Fix per i modal */
.modal {
    z-index: 9999 !important;
    display: none; /* Nascondi di default */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
}

/* Rimuovi completamente il backdrop */
.modal-backdrop {
    display: none !important;
    opacity: 0 !important;
}

.modal-dialog {
    margin: 4rem auto !important;
    max-width: 600px !important;
    position: relative !important;
}

.modal-content {
    border: none !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    background-color: #fff !important;
}

/* Rimuovi gli stili che bloccano l'interazione */
body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .nav-item .nav-link {
        padding: 0.5rem 0.8rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .icon-container i {
        font-size: 1.2rem !important;
    }
}

/* Timeline per Note Mediche */
.medical-notes-timeline {
    max-height: 500px;
    overflow-y: auto;
}

.timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    display: flex;
    margin-bottom: 2rem;
    padding-left: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 2.5rem;
    bottom: -2rem;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    z-index: 1;
}

.timeline-content {
    flex: 1;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 1rem;
    width: 0;
    height: 0;
    border-top: 0.5rem solid transparent;
    border-bottom: 0.5rem solid transparent;
    border-right: 0.5rem solid #dee2e6;
}

.timeline-content::after {
    content: '';
    position: absolute;
    left: -0.4375rem;
    top: 1.0625rem;
    width: 0;
    height: 0;
    border-top: 0.4375rem solid transparent;
    border-bottom: 0.4375rem solid transparent;
    border-right: 0.4375rem solid #ffffff;
}

.timeline-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.timeline-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
    flex: 1;
}

.timeline-date {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.timeline-body {
    color: #212529;
    line-height: 1.5;
}

.timeline-recent {
    position: relative;
}

.timeline-recent .timeline-content {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.timeline-recent .timeline-content::before {
    border-right-color: #0d6efd;
}

.timeline-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
}