/* Bootstrap-Aligned Notification Toast Styles */

#notification-toast-container {
    position: fixed;
    top: 90px;  /* Slightly lower to avoid dropdown overlap */
    right: 15px;
    z-index: 1055;  /* Bootstrap dropdown is 1050, modal is 1060 */
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: 360px;
    pointer-events: none;
}

.modern-notification-toast {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transform: translateX(120%);  /* Slide from just outside viewport */
    opacity: 0;
    transition: all 0.3s ease;
    width: 100%;  /* Use container width instead of min-width */
}

.modern-notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.modern-notification-toast.hide {
    transform: translateX(120%);  /* Slide back out */
    opacity: 0;
}

.toast-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon {
    font-size: 20px;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    line-height: 1.4;
    flex: 1;
}

.toast-priority-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.toast-message {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.toast-action-btn {
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.toast-action-btn:hover {
    opacity: 0.85;
}

.toast-close-btn {
    background: transparent;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    position: absolute;
    top: 12px;
    right: 12px;
}

.toast-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.toast-close-btn i {
    font-size: 14px;
}

.toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: progressBar 6s linear;
    transform-origin: left;
}

@@keyframes progressBar {
    0% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(0);
    }
}

/* Hover effect - pause progress */
.modern-notification-toast:hover .toast-progress-bar {
    animation-play-state: paused;
}

/* Subtle hover effect */
.modern-notification-toast:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}

/* Responsive design */
@@media (max-width: 768px) {
    #notification-toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        width: auto;
    }

    .modern-notification-toast {
        width: 100%;
        padding: 12px;
    }

    .toast-icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .toast-icon {
        font-size: 18px;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 12px;
    }
}

/* Multiple toast stacking */
.modern-notification-toast:nth-child(n+4) {
    display: none;
}

/* Accessibility improvements */
.modern-notification-toast:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Reduce motion for users with motion sensitivity */
@@media (prefers-reduced-motion: reduce) {
    .modern-notification-toast,
    .modern-notification-toast.show,
    .modern-notification-toast.hide,
    .toast-progress-bar {
        animation: none;
        transition: none;
    }

    .modern-notification-toast {
        transform: none;
    }

    .modern-notification-toast.show {
        opacity: 1;
    }

    .modern-notification-toast.hide {
        opacity: 0;
    }
}

/* Notification Dropdown Item Styles */
.notification-item {
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.notification-unread {
    background-color: #f0f7ff;
}

.notification-item.notification-unread:hover {
    background-color: #e6f2ff;
}

.notification-item .avatar-xs {
    width: 2rem;
    height: 2rem;
}

.notification-item .avatar-title {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.notification-item .btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1;
}

.notification-item h6 {
    color: #212529;
}

.notification-item .fs-xs {
    font-size: 0.75rem;
}

.notification-list-container {
    background: #fff;
}

/* Section headers in notification list */
.notification-section-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    background-color: #f8f9fa;
    margin: 0;
}

/* Ensure dropdown doesn't conflict with toasts */
.dropdown-menu {
    z-index: 1050;  /* Standard Bootstrap dropdown z-index */
}

/* Additional fixes for viewport containment */
@@media (max-width: 576px) {
    #notification-toast-container {
        top: 65px;
        right: 5px;
        left: 5px;
        max-width: calc(100% - 10px);
    }

    .modern-notification-toast {
        padding: 10px;
    }

    .toast-close-btn {
        top: 8px;
        right: 8px;
    }
}
