/* static/css/components/notifications.css - UPDATED WITH TOP BADGE */
.notification-bell {
    position: relative;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.notification-bell:hover {
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.notification-bell.has-unread {
    animation: bell-shake 0.5s ease-in-out;
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* TOP-POSITIONED BADGE */
.notification-badge {
    position: absolute;
    top: 0;
    right: 8px; /* Adjust to be at top-right of bell */
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-pop 0.3s ease;
    pointer-events: none;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--surface); /* Creates a border effect */
    z-index: 10;
}

/* Red color override - make sure it's bright red */
.notification-badge {
    background: #ff4757 !important; /* Bright red */
    color: white !important;
}

@keyframes badge-pop {
    0% { transform: scale(0) translateY(-10px); opacity: 0; }
    70% { transform: scale(1.1) translateY(0); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Red pulse animation for unread notifications */
.notification-pulse {
    animation: red-pulse 2s infinite;
}

@keyframes red-pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7),
                    0 0 0 2px var(--surface); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface);
    }
}

/* Mobile Notification Badge - also at top */
.mobile-notification-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #ff4757;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--surface);
}

/* Dark theme adjustments */
[data-theme="dark"] .notification-badge {
    box-shadow: 0 0 0 2px var(--surface-dark);
}

[data-theme="dark"] .notification-pulse {
    animation: red-pulse-dark 2s infinite;
}

@keyframes red-pulse-dark {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7),
                    0 0 0 2px var(--surface-dark); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface-dark);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface-dark);
    }
}

[data-theme="dark"] .mobile-notification-badge {
    box-shadow: 0 0 0 2px var(--surface-dark);
}

/* Bell animation when new notification arrives */
@keyframes bell-ring {
    0% { transform: rotate(0); }
    10% { transform: rotate(-15deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(5deg); }
    50% { transform: rotate(-5deg); }
    60% { transform: rotate(2deg); }
    70% { transform: rotate(-2deg); }
    80% { transform: rotate(1deg); }
    90% { transform: rotate(-1deg); }
    100% { transform: rotate(0); }
}

.notification-new {
    animation: bell-ring 1s ease;
}

/* Hover effect for bell */
.notification-bell::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
    border-radius: 50%;
    background: var(--primary-blue-light);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.notification-bell:hover::after {
    opacity: 0.3;
}

/* Responsive: Hide desktop bell on mobile, show mobile link */
@media (max-width: 768px) {
    .notification-bell {
        display: none;
    }
    
    .mobile-nav-link {
        position: relative;
    }
}

/* Add to navbar.css to ensure proper spacing */
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

/* Make sure the bell icon has enough space for the badge */
.notification-bell i {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}
/* Toast animations */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}