/* ===== NOTIFICATION SYSTEM ===== */
/* Notification bubbles, history, and cloud save indicator */

/* Notification Container */
.notification-container {
    position: fixed;
    top: var(--spacing-medium);
    left: var(--spacing-medium);
    z-index: calc(var(--z-modal) + 100);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-small);
    max-width: 300px;
    pointer-events: none;
}

/* Notification Bubble - Chat Bubble Style */
.notification-bubble {
    background: var(--color-surface-modal);
    border: 2px solid var(--color-border-primary); /* Increased from 1px */
    border-radius: 18px;
    padding: 14px 18px; /* Increased from 10px 14px for better thickness */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: auto;
    width: auto; /* Auto-width based on content */
    max-width: 100%;
    word-wrap: break-word;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px; /* Increased from 10px */
    min-height: 48px; /* Ensure minimum height for visibility */
}

.notification-bubble.notification-visible {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.notification-bubble.notification-removing {
    transform: translateX(-100%) scale(0.95);
    opacity: 0;
}

/* Colored bullet indicator */
.notification-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.notification-message {
    font-size: var(--font-size-md); /* Increased from sm for better readability */
    color: var(--color-text-primary);
    line-height: var(--line-height-normal);
    display: block;
    flex: 1;
    font-weight: var(--font-weight-medium); /* Slightly bolder for visibility */
}

/* Type-specific notification bullet colors */
.notification-bubble.notification-save .notification-bullet {
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.notification-bubble.notification-item .notification-bullet {
    background: #8b5cf6;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}

.notification-bubble.notification-pet .notification-bullet {
    background: #ec4899;
    box-shadow: 0 0 6px rgba(236, 72, 153, 0.5);
}

.notification-bubble.notification-achievement .notification-bullet {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.notification-bubble.notification-levelup .notification-bullet {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.notification-bubble.notification-transformation .notification-bullet {
    background: #06b6d4;
    box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
}

.notification-bubble.notification-checkin .notification-bullet {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.notification-bubble.notification-info .notification-bullet {
    background: #6b7280;
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.5);
}

.notification-bubble.notification-success .notification-bullet {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.notification-bubble.notification-error .notification-bullet {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.notification-bubble.notification-system .notification-bullet {
    background: #9ca3af;
    box-shadow: 0 0 6px rgba(156, 163, 175, 0.5);
}

/* Notification History - Chat Log Style */
.notification-chat-section {
    padding: var(--spacing-medium) !important;
}

.notification-chat-container {
    background: transparent;
    border: none;
    overflow: visible;
    margin: 0;
    max-height: min(500px, calc(100vh - 350px));
    display: flex;
    flex-direction: column;
}

.notification-chat-feed {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: var(--spacing-xs);
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

/* Custom scrollbar for chat feed */
.notification-chat-feed::-webkit-scrollbar {
    width: 8px;
}

.notification-chat-feed::-webkit-scrollbar-track {
    background: transparent;
}

.notification-chat-feed::-webkit-scrollbar-thumb {
    background: var(--color-border-secondary);
    border-radius: 4px;
}

.notification-chat-feed::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* Individual chat message - Pill-shaped bubble matching live notifications */
.notification-chat-message {
    background: var(--color-surface-modal);
    border: 1px solid var(--color-border-primary);
    border-radius: 18px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    margin-bottom: var(--spacing-small);
}

.notification-chat-message:last-child {
    margin-bottom: 0;
}

.notification-chat-message:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.notification-chat-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.notification-chat-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-small);
}

.notification-chat-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    line-height: var(--line-height-normal);
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.notification-chat-time {
    font-size: 13px; /* Slightly larger than 12px, but not as large as 14px */
    color: var(--color-text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
}

.notification-chat-actions {
    padding: var(--spacing-medium) 0 0 0;
    border: none;
    background: transparent;
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-medium);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-small);
}

/* Mobile adjustments */
@media (max-width: 400px) {
    .notification-container {
        top: var(--spacing-medium); /* Increased from small */
        left: var(--spacing-medium);
        max-width: calc(100vw - var(--spacing-large));
    }
    
    .notification-bubble {
        padding: 16px 20px; /* Increased padding for more fun look */
        min-height: 48px; /* Minimum touch target */
        border-width: 2px;
        width: auto; /* Auto-width based on content */
        max-width: calc(100vw - var(--spacing-large) * 2); /* Ensure it doesn't overflow */
    }
    
    .notification-message {
        font-size: var(--font-size-md); /* Increased from sm - slightly larger font */
        line-height: 1.4;
        white-space: normal; /* Allow wrapping on mobile if needed */
    }
    
    .notification-chat-container {
        max-height: min(400px, calc(100vh - 300px));
    }
    
    .notification-chat-feed {
        padding: var(--spacing-small);
        gap: var(--spacing-small); /* Increased from xs */
    }
    
    .notification-chat-message {
        padding: var(--spacing-small) var(--spacing-medium); /* Increased from xs */
        min-height: 44px;
    }
    
    .notification-chat-text {
        font-size: var(--font-size-sm); /* Increased from xs */
        line-height: 1.4;
    }
}

@media (max-width: 375px) {
    .notification-container {
        top: var(--spacing-small);
        left: var(--spacing-small);
        right: var(--spacing-small);
        max-width: calc(100vw - var(--spacing-medium));
    }
    
    .notification-bubble {
        padding: 16px 20px; /* Increased padding for more fun look */
        max-width: calc(100vw - var(--spacing-medium) * 2); /* Ensure it doesn't overflow */
        min-height: 48px; /* Minimum touch target */
        border-width: 2px;
        width: auto; /* Auto-width based on content */
    }
    
    .notification-message {
        font-size: var(--font-size-md); /* Increased from sm - slightly larger font */
        line-height: 1.4;
        white-space: normal; /* Allow wrapping on mobile if needed */
    }
    
    .notification-chat-text {
        font-size: var(--font-size-sm); /* Increased from xs */
        line-height: 1.4;
    }
}

