/**
 * Notification System Styles
 * Glass-morphism design matching MindStage UI
 *
 * Self-contained with fallback values for CSS variables
 * Works with any base template (base.html, base_modern.html, admin/base.html)
 */

/* Define local variables with fallbacks for compatibility */
:root {
    /* Popover surface — always opaque so behind content never bleeds through. */
    --notification-bg: #151824;
    --notification-glass: var(--glass, rgba(255, 255, 255, 0.05));
    --notification-border: var(--glass-border, rgba(255, 255, 255, 0.1));
    --notification-text: var(--text, #e7e7ee);
    --notification-muted: var(--muted, #8a8c9e);
    --notification-accent: var(--accent, #7c9cff);
    --notification-accent-2: var(--accent-2, #9bffdc);
    --notification-gold: var(--gold, #ffd700);
}

/* Notification Bell Button */
.notification-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-bell-btn {
    position: relative;
    background: var(--notification-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--notification-border);
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    color: var(--notification-text);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.notification-bell-btn:hover {
    background: rgba(124, 156, 255, 0.08);
    border-color: rgba(124, 156, 255, 0.2);
    transform: translateY(-2px);
}

.notification-bell-btn > span:first-child {
    line-height: 1;
}

/* Badge - matches both class and ID for backwards compatibility */
.notification-badge,
#notificationBadge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: badge-appear 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Pulse Animation for New Notifications */
.notification-pulse {
    animation: pulse-bell 0.8s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-bell {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15) rotate(5deg);
    }
    50% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.15) rotate(5deg);
    }
}

@keyframes badge-appear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dropdown Panel */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 420px;
    max-width: 90vw;
    max-height: 600px;
    background: var(--notification-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--notification-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--notification-border);
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--notification-text);
}

.mark-all-read-btn {
    background: transparent;
    border: none;
    color: var(--notification-accent);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mark-all-read-btn:hover {
    background: rgba(124, 156, 255, 0.1);
}

.notification-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notification-close-btn {
    background: transparent;
    border: none;
    color: var(--notification-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--notification-text);
}

/* Notification List */
.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

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

.notification-list::-webkit-scrollbar-thumb {
    background: rgba(124, 156, 255, 0.3);
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 156, 255, 0.5);
}

/* Notification Item */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
    animation: notification-slide-in 0.3s ease;
}

.notification-item:hover {
    background: rgba(124, 156, 255, 0.05);
    border-color: rgba(124, 156, 255, 0.1);
}

.notification-item.unread {
    background: rgba(124, 156, 255, 0.08);
    border-color: rgba(124, 156, 255, 0.2);
}

@keyframes notification-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Icon - Removed, no longer using emoji icons */

/* Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--notification-text);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--notification-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

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

.notification-action {
    font-size: 0.8rem;
    color: var(--notification-accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.notification-action:hover {
    color: var(--notification-accent-2);
}

/* Dismiss Button */
.notification-dismiss {
    background: transparent;
    border: none;
    color: var(--notification-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--notification-text);
}

/* Empty State */
.notification-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--notification-muted);
}

.notification-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Footer */
.notification-footer {
    border-top: 1px solid var(--notification-border);
    padding: 0.75rem 1rem;
    text-align: center;
}

.view-all-btn {
    color: var(--notification-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-all-btn:hover {
    color: var(--notification-accent-2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed;
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 72px);
        max-height: calc(100dvh - 72px);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .notification-dropdown.active {
        transform: translateY(0);
    }

    /* .notification-bell-btn inherits from .nav-btn on mobile too */
}

@media (max-width: 640px) {
    .notification-item {
        padding: 0.75rem;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .notification-title {
        font-size: 0.9rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }
}
