/* ============================================
   NOTIFICATIONS MODERNES - Style cohérent
   ============================================ */

/* === Suppression des outlines bleus indésirables === */
.notification-item-modern *:focus,
.notificationsTable *:focus,
.notification-modal *:focus {
    outline: none !important;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid rgba(55, 114, 255, 0.3);
    outline-offset: 2px;
}

/* === Dropdown de notification dans le header === */
.header .header__right .notification .dropdown-toggle {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.header .header__right .notification .dropdown-toggle:focus,
.header .header__right .notification .dropdown-toggle:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.header .header__right .notification .dropdown-menu {
    max-width: 90vw;
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.75rem;
    background: #ffffff;
}

.header .header__right .notification .dropdown-menu.show {
    left: auto !important;
    right: 0;
    transform: translate3d(0, 42px, 0px) !important;
}

/* Item de notification moderne */
.notification-item-modern {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.notification-item-modern:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateX(2px);
}

.notification-item-modern:last-of-type {
    margin-bottom: 0;
}

/* Header de la notification */
.notif-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3772ff 0%, #5b8eff 100%);
    color: #ffffff;
    font-size: 1rem;
}

.notif-icon.type-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.notif-icon.type-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.notif-icon.type-error {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.notif-icon.type-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

/* Contenu de la notification */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-family: "Poppins", sans-serif;
    font-size: 0.825rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    word-break: break-word;
}

.notif-desc {
    font-family: "Poppins", sans-serif;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    word-break: break-word;
}

.notif-date {
    font-family: "Poppins", sans-serif;
    font-size: 0.7rem;
    color: #9ca3af;
    font-style: italic;
    margin: 0;
}

/* Actions de notification */
.notif-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.notif-action {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: linear-gradient(135deg, #3772ff 0%, #5b8eff 100%);
    color: #ffffff;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.notif-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 114, 255, 0.3);
    color: #ffffff !important;
    text-decoration: none;
}

.notif-action:focus,
.notif-action:active {
    outline: none;
    box-shadow: 0 4px 12px rgba(55, 114, 255, 0.3);
    color: #ffffff !important;
}

/* Footer du dropdown */
.dropdown-footer {
    padding: 0.75rem 0.5rem 0.25rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    margin-top: 0.5rem;
}

.see-all-notif {
    font-family: "Poppins", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3772ff;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.see-all-notif:hover {
    color: #2758d4;
    text-decoration: none;
    transform: translateX(2px);
}

.see-all-notif i {
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.see-all-notif:hover i {
    transform: translateX(3px);
}

/* === Table des notifications (Account Overview) === */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.notificationsTable {
    margin-bottom: 0 !important;
}

.notificationsTable tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.notificationsTable tr:hover {
    background: #f9fafb;
}

.notificationsTable td {
    font-family: "Poppins", sans-serif;
    vertical-align: middle;
    padding: 0.75rem 0.6rem;
}

.notificationsTable .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3772ff 0%, #5b8eff 100%);
    font-size: 0.9rem;
}

.notificationsTable .notif-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.notif-row-title {
    font-weight: 600;
    color: #111827;
    font-size: 0.825rem;
}

.notif-row-desc {
    color: #6b7280;
    font-size: 0.775rem;
    line-height: 1.4;
}

.notif-row-date {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Boutons d'action dans la table */
.notificationsTable .btn-outline-primary {
    transition: all 0.2s ease;
}

.notificationsTable .btn-outline-primary:hover {
    background: #3772ff;
    border-color: #3772ff;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(55, 114, 255, 0.3);
}

.notificationsTable .btn-outline-primary:focus,
.notificationsTable .btn-outline-primary:active {
    outline: none;
    background: #3772ff;
    border-color: #3772ff;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(55, 114, 255, 0.25);
}

/* Badge de statut */
.notif-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-status-badge.unread {
    background: #dbeafe;
    color: #1e40af;
}

.notif-status-badge.read {
    background: #d1fae5;
    color: #065f46;
}

/* === Modal de détails de notification === */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(35, 38, 47, 0.5);
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeInOverlay 0.18s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.notification-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(35, 38, 47, 0.5);
}

.notification-modal-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.notification-modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-modal-header {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem;
    position: relative;
}

.close-notification-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-notification-modal:hover {
    background: #f3f4f6;
    color: #111827;
}

.notification-modal-body {
    padding: 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.notification-modal-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.notification-modal-footer .btn-outline-primary:hover {
    background: #3772ff;
    border-color: #3772ff;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 114, 255, 0.3);
}

.notification-modal-footer .btn-outline-primary:focus,
.notification-modal-footer .btn-outline-primary:active {
    background: #3772ff;
    border-color: #3772ff;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(55, 114, 255, 0.25);
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === Pagination moderne === */
#pagination .pagination {
    gap: 0.5rem;
}

#pagination .page-item {
    margin: 0;
}

#pagination .page-link {
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

#pagination .page-link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

#pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #3772ff 0%, #5b8eff 100%);
    border-color: #3772ff;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(55, 114, 255, 0.3);
}

/* === Responsive === */
@media (max-width: 768px) {
    .header .header__right .notification .dropdown-menu {
        width: calc(100vw - 2rem);
        max-width: 350px;
    }

    .notification-item-modern {
        padding: 0.65rem;
    }

    .notif-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .notif-title {
        font-size: 0.775rem;
    }

    .notif-desc {
        font-size: 0.7rem;
    }

    .notif-date {
        font-size: 0.65rem;
    }
    
    .notif-action {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Table responsive */
    .table-responsive {
        max-height: 500px;
    }
    
    .notificationsTable td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .notificationsTable .notif-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .notif-row-title {
        font-size: 0.775rem;
    }
    
    .notif-row-desc {
        font-size: 0.725rem;
    }
    
    .notif-row-date {
        font-size: 0.7rem;
    }
    
    /* Modal responsive */
    .notification-modal-wrapper {
        padding: 0.75rem;
        max-width: 95%;
    }
    
    .notification-modal-body {
        max-height: 50vh;
    }
}

@media (max-width: 575.98px) {
    .header .header__right .notification .dropdown-menu,
    .header .header__right .notification .dropdown-menu.show {
        position: fixed !important;
        margin-top: 50px;
        left: 50% !important;
        transform: translate(-50%, 0) !important;
        width: calc(100vw - 2rem);
        max-width: 100%;
    }
    
    /* Table ultra compact sur mobile */
    .table-responsive {
        max-height: 400px;
    }
    
    .notificationsTable td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .notificationsTable .notif-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .notif-row-title {
        font-size: 0.75rem;
    }
    
    .notif-row-desc {
        font-size: 0.7rem;
        min-width: 180px !important;
    }
    
    .notif-row-date {
        font-size: 0.675rem;
    }
    
    /* Modal encore plus compact */
    .notification-modal-wrapper {
        padding: 0.5rem;
    }
    
    .notification-modal-header {
        padding: 1rem;
    }
    
    .notification-modal-body {
        padding: 1rem;
        max-height: 40vh;
    }
    
    .notification-modal-footer {
        padding: 0.875rem 1rem;
        flex-direction: column;
    }
    
    .notification-modal-footer .btn {
        width: 100%;
    }
}

/* === Empty state === */
.notification-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.notification-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notification-empty-state p {
    font-family: "Poppins", sans-serif;
    font-size: 0.9rem;
    margin: 0;
}

/* === Scroll personnalisé === */
.header .header__right .notification .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.header .header__right .notification .dropdown-menu::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.header .header__right .notification .dropdown-menu::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.header .header__right .notification .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

