/**
 * Modal Custom Styles
 * Stili personalizzati per le modal Bootstrap
 */

/* Modal Base Styles */
.modal-dialog {
    margin-top: 100px !important; /* Spazio per la navbar superiore (area pubblica) */
}

/* Assicura che la modal non venga coperta dalla navbar */
.modal.show .modal-dialog {
    margin-top: 100px !important;
}

/* Z-index elevato per le modal - sopra tutti gli elementi incluso navbar */
.modal {
    z-index: 10050 !important; /* Sopra navbar (9999) e altri elementi */
}

.modal-backdrop {
    z-index: 10040 !important; /* Sotto la modal ma sopra tutto il resto */
}

.modal-dialog {
    z-index: 10050 !important; /* Stesso della modal */
}

.modal-content {
    z-index: 10050 !important; /* Stesso della modal */
}

/* Dashboard: margine aumentato per la navbar dashboard */
.modal-dashboard .modal-dialog {
    margin-top: 120px !important; /* Spazio aumentato per dashboard */
}

.modal-dashboard.show .modal-dialog {
    margin-top: 120px !important;
}

.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Stili per area pubblica (chiaro) */
.modal-public .modal-content {
    background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-public .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

.modal-public .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

/* Stili per dashboard (più scuro) */
.modal-dashboard .modal-content {
    background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-dashboard .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #ffffff;
}

.modal-dashboard .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #ffffff;
}

/* Stili header e footer di default (per retrocompatibilità) */
.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #212529;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

/* Pulsante dorato per area pubblica (come nello screenshot) */
.modal-public .modal-footer .btn-gold,
.btn-gold {
    background-color: #FFD700 !important;
    border-color: #FFD700 !important;
    color: #000000 !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}

.modal-public .modal-footer .btn-gold:hover,
.btn-gold:hover {
    background-color: #FFC700 !important;
    border-color: #FFC700 !important;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

/* Pulsante warning per dashboard (giallo Bootstrap) */
.modal-dashboard .modal-footer .btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
    font-weight: 600 !important;
}

.modal-dashboard .modal-footer .btn-warning:hover {
    background-color: #ffca2c !important;
    border-color: #ffca2c !important;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.modal-footer .btn {
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-footer .btn svg {
    transition: transform 0.2s ease;
}

.modal-footer .btn:hover svg {
    transform: translateX(4px);
}

/* Notifications Modal */
#notificationsModal .notifications-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #fff9e6;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon-container {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    position: relative;
}

.notification-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-icon {
    font-size: 20px;
    color: #ffffff;
    display: block;
    line-height: 1;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.notification-content {
    min-width: 0;
    flex: 1;
}

.notification-message {
    font-size: 14px;
    line-height: 1.4;
    color: #212529 !important;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.notification-unread .notification-message {
    font-weight: 600;
    color: #212529 !important;
}

.notification-user {
    font-size: 12px;
    color: #6c757d !important;
    margin-bottom: 2px;
}

.notification-time {
    font-size: 12px;
    color: #6c757d !important;
    margin-top: 2px;
}

/* Messages Modal */
#messagesModal .messages-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
}

.message-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    cursor: pointer;
    color: #212529;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item.unread {
    background-color: #e7f3ff;
}

.message-item strong {
    color: #212529;
}

.message-item p {
    color: #6c757d;
}

.message-item small {
    color: #6c757d;
}

.message-item:last-child {
    border-bottom: none;
}

/* Feed Modal */
#feedModal .feed-content {
    max-height: 600px;
    overflow-y: auto;
    padding: 0;
}

.feed-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.feed-item:last-child {
    border-bottom: none;
}

/* Empty State */
.modal-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.modal-empty-state svg {
    width: 64px;
    height: 64px;
    color: #6c757d;
    margin-bottom: 1rem;
}

.modal-empty-state h5 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.modal-empty-state p {
    color: #6c757d;
    margin: 0;
}

/* Loading State */
.modal-loading {
    text-align: center;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        margin-top: 60px !important; /* Spazio ridotto su mobile */
    }
    
    /* Dashboard mobile: margine aumentato */
    .modal-dashboard .modal-dialog {
        margin-top: 100px !important; /* Spazio aumentato su mobile dashboard */
    }
    
    .modal-dashboard.show .modal-dialog {
        margin-top: 100px !important;
    }
    
    .modal-content {
        border-radius: 8px 8px 0 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    #notificationsModal .notifications-list,
    #messagesModal .messages-list,
    #feedModal .feed-content {
        max-height: 400px;
    }
}

/* Scrollbar personalizzata */
.modal-body::-webkit-scrollbar,
.notifications-list::-webkit-scrollbar,
.messages-list::-webkit-scrollbar,
.feed-content::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track,
.notifications-list::-webkit-scrollbar-track,
.messages-list::-webkit-scrollbar-track,
.feed-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb,
.notifications-list::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb,
.feed-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.notifications-list::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover,
.feed-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

