/* Notifications Components CSS */

.join-notification, .earnings-notification, .learning-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: flex;
    align-items: center;
    width: 300px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 1000;
}

/* Fix class name mismatch - JS uses 'show' class instead of 'visible' */
.join-notification.show,
.earnings-notification.show,
.learning-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notifications-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
    display: block !important;
}

.join-notification, .learning-notification {
    pointer-events: auto;
}

.earnings-notification {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(108, 99, 255, 0.2));
    border: 1px solid rgba(76, 175, 80, 0.3);
    bottom: 90px; /* Position above the join notification */
}

.learning-notification {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 87, 34, 0.2));
    border: 1px solid rgba(255, 193, 7, 0.3);
    bottom: 160px; /* Position above the earnings notification */
}

.learning-notification .achievement-type {
    color: #ff6d00;
    font-weight: 700;
}

.earnings-notification .earnings-amount {
    color: var(--secondary-color);
    font-weight: 700;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    background-color: #f0f0f0; /* Fallback background */
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add fallback styling for avatar image failures */
.notification-avatar img:not([src]), 
.notification-avatar img[src=""], 
.notification-avatar img.error {
    opacity: 0;
}

.notification-content {
    line-height: 1.4;
}

.notification-name {
    font-weight: 600;
    color: var(--primary-color);
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-color-muted);
}

@media (max-width: 768px) {
    .join-notification, .earnings-notification, .learning-notification {
        width: 280px;
        right: 15px;
        bottom: 15px;
        padding: 12px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .learning-notification {
        bottom: 100px; /* Adjust for mobile spacing */
    }
    
    .earnings-notification {
        bottom: 185px; /* Adjust for mobile spacing */
    }
    
    .notification-avatar {
        width: 35px;
        height: 35px;
        margin-right: 12px;
    }
    
    .notification-content {
        line-height: 1.3;
    }
    
    .notification-name {
        font-size: 13px;
        font-weight: 600;
    }
    
    .notification-time {
        font-size: 11px;
        margin-top: 2px;
    }
    
    .profit-amount {
        font-weight: 700;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .join-notification, .earnings-notification, .learning-notification {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
        padding: 10px;
        font-size: 12px;
        max-width: 320px;
    }
    
    .learning-notification {
        bottom: 80px;
    }
    
    .earnings-notification {
        bottom: 150px;
    }
    
    .notification-avatar {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
    
    .notification-name {
        font-size: 12px;
    }
    
    .notification-time {
        font-size: 10px;
    }
    
    .profit-amount {
        font-size: 12px;
    }
}

/* Desktop optimization for larger screens */
@media (min-width: 1200px) {
    .join-notification, .earnings-notification, .learning-notification {
        width: 320px;
        right: 30px;
        bottom: 30px;
        padding: 18px;
        font-size: 14px;
    }
    
    .learning-notification {
        bottom: 180px;
    }
    
    .earnings-notification {
        bottom: 120px;
    }
    
    .notification-avatar {
        width: 45px;
        height: 45px;
        margin-right: 18px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .join-notification, .earnings-notification, .learning-notification {
        transition: opacity 0.3s ease;
        transform: none !important;
    }
    
    .join-notification.show,
    .earnings-notification.show,
    .learning-notification.show {
        transform: none !important;
    }
}
