/* Notification Bell Styles */
.notification-dropdown {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    position: absolute !important;
    z-index: 1050 !important;
    width: 420px !important;
    max-width: 95vw !important;
    right: 0 !important;
    left: unset !important;
    transform: none !important;
    top: 100% !important;
    margin-top: 0.5rem !important;
}

/* Mobile specific positioning - Override ALL positioning */
@media (max-width: 768px) {
    .notification-dropdown,
    .responsive-dropdown,
    body[class*="kanban"] .notification-dropdown,
    .kanban-board-wrapper ~ .notification-dropdown,
    [data-controller="KanbanTasks"] .notification-dropdown,
    .navbar .dropdown-menu.notification-dropdown,
    .dropdown-menu.notification-dropdown {
        position: fixed !important;
        right: 0.5rem !important;
        left: auto !important;
        width: calc(100vw - 1rem) !important;
        max-width: 320px !important;
        top: calc(var(--navbar-height, 56px) + 0.5rem) !important;
        margin: 0 !important;
        transform: none !important;
        max-height: calc(100vh - 120px) !important;
        z-index: 1060 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        border-radius: 0.5rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    }
}

/* Fix for Kanban Tasks page specifically - Desktop only */
@media (min-width: 769px) {
    body[class*="kanban"] .notification-dropdown,
    .kanban-board-wrapper ~ .notification-dropdown,
    [data-controller="KanbanTasks"] .notification-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 60px !important;
        max-height: 400px !important;
    }
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    cursor: pointer;
    word-wrap: break-word;
    max-width: 100%;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #f0f8ff;
    border-left: 3px solid #007bff;
}

.notification-item.read {
    opacity: 0.7;
}

.notification-item:last-child {
    border-bottom: none;
}

/* Ensure notification dropdown is always properly positioned regardless of parent container */
.dropdown-menu.notification-dropdown {
    position: absolute !important;
    min-width: 300px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Additional mobile safeguards to prevent cutoff */
@media (max-width: 480px) {
    .notification-dropdown,
    .responsive-dropdown {
        right: 0.25rem !important;
        width: calc(100vw - 0.5rem) !important;
        max-width: none !important;
        left: auto !important;
    }
}

/* Fallback for very small screens */
@media (max-width: 320px) {
    .notification-dropdown,
    .responsive-dropdown {
        right: 0.125rem !important;
        width: calc(100vw - 0.25rem) !important;
        font-size: 0.875rem !important;
    }
}

.notification-item .fw-bold {
    color: #333;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-item .text-muted {
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.mark-read-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.mark-read-btn:hover {
    background-color: #e9ecef;
}

.delete-notification-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.delete-notification-btn:hover {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.delete-notification-btn i {
    font-size: 0.7rem;
}

/* Badge positioning */
#notification-badge {
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    transform: translate(25%, -25%);
}

/* Connection status indicator */
#notification-status {
    color: #ffc107;
    transform: translate(50%, 50%);
}

#notification-status.text-success {
    color: #28a745 !important;
}

#notification-status.text-warning {
    color: #ffc107 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 360px !important;
        max-width: 90vw;
    }
}

/* Loading state */
.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

/* Empty state */
.notification-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Notification type indicators */
.notification-type-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.notification-type-overdue {
    background-color: #dc3545;
}

.notification-type-upcoming {
    background-color: #ffc107;
}

.notification-type-stuck {
    background-color: #fd7e14;
}

.notification-type-general {
    background-color: #6c757d;
}

.notification-type-system-message {
    background-color: #17a2b8;
}

.notification-type-system-announcement {
    background-color: #28a745;
}

.notification-type-system-maintenance {
    background-color: #e83e8c;
}

/* Animation for new notifications */
@keyframes notification-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notification-bell-pulse {
    animation: notification-pulse 0.6s ease-in-out;
}

/* Notification bell button */
#notification-bell {
    position: relative;
    transition: all 0.2s ease;
}

#notification-bell:hover {
    transform: scale(1.05);
}

#notification-bell.has-unread {
    color: #ffc107;
}

/* Scrollbar styling for notification list */
#notification-list::-webkit-scrollbar {
    width: 6px;
}

#notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#notification-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#notification-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
