/* Notification Button Wrapper: ensures badge anchors to icon */
.notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border-radius: 9999px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    line-height: 16px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Loading Animation */
.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: 50%;
    animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDots {
    0%, 100% { transform: scale(0.3); opacity: 0.3; }
    50% { transform: scale(1); opacity: 1; }
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast-content h4 {
    margin: 0 0 8px 0;
    color: #1F2937;
    font-size: 16px;
    font-weight: 600;
}

.notification-toast-content p {
    margin: 0;
    color: #4B5563;
    font-size: 14px;
    line-height: 1.4;
}

/* Notifications Panel */
.notifications-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 360px;
    max-height: 480px;
    z-index: 1000;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.notifications-panel.show {
    transform: translateY(0);
    opacity: 1;
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    color: #1F2937;
    font-size: 18px;
    font-weight: 600;
}

.notifications-actions {
    display: flex;
    gap: 8px;
}

.mark-all-read-btn,
.delete-all-btn {
    background: none;
    border: none;
    color: #4F46E5;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mark-all-read-btn:hover,
.delete-all-btn:hover {
    background: rgba(79, 70, 229, 0.1);
}

.delete-all-btn {
    color: #EF4444;
}

.delete-all-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.notifications-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.notification-item.unread {
    background: rgba(79, 70, 229, 0.05);
}

.notification-item:hover {
    background: #F9FAFB;
}

.notification-content {
    flex: 1;
    margin-right: 12px;
}

.notification-content h4 {
    margin: 0 0 4px 0;
    color: #1F2937;
    font-size: 14px;
    font-weight: 600;
}

.notification-content p {
    margin: 0 0 4px 0;
    color: #4B5563;
    font-size: 13px;
    line-height: 1.4;
}

.notification-time {
    color: #9CA3AF;
    font-size: 12px;
}

.notification-actions {
    display: flex;
    gap: 4px;
}

.mark-read-btn,
.delete-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #9CA3AF;
    transition: all 0.2s ease;
}

.mark-read-btn:hover {
    color: #4F46E5;
    background: rgba(79, 70, 229, 0.1);
}

.delete-btn:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.no-notifications {
    text-align: center;
    color: #9CA3AF;
    padding: 24px;
    font-size: 14px;
}

/* Scrollbar styling */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Achievement Notification Styles */
.achievement-notification {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: 0.75rem;
    color: white;
}

.achievement-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: achievementPulse 2s infinite;
}

.achievement-content {
    flex: 1;
}

.achievement-content h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.achievement-content p {
    margin: 0.25rem 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

@keyframes achievementPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}