/**
 * SQUIZITO FAN - NOTIFICATION SYSTEM STYLES
 *
 * Mobile-first design for in-app notifications
 * Integrates with Communications API backend
 *
 * Components:
 * - Notification bell (header component)
 * - Notification panel/drawer (mobile/desktop)
 * - Notification items
 * - Category filters
 * - Toast notifications
 */

/* ============================================
   NOTIFICATION BELL (HEADER COMPONENT)
   ============================================ */

.notification-bell-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.notification-bell-container:hover {
    background: rgba(179, 244, 0, 0.1);
}

.notification-bell-icon {
    font-size: 1.5rem;
    color: var(--text-primary, #ffffff);
    transition: transform 0.3s ease;
    position: relative;
    display: block;
}

.notification-bell-container:hover .notification-bell-icon {
    transform: rotate(15deg);
}

/* Badge with unread count */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger, #ff3366);
    color: #ffffff;
    font-size: 0.7rem;
    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 2px 4px rgba(255, 51, 102, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(255, 51, 102, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 2px 8px rgba(255, 51, 102, 0.6);
    }
}

.notification-badge.hidden {
    display: none;
}

/* New notification animation */
.notification-bell-icon.new-notification {
    animation: bellRing 0.5s ease-in-out 3;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(15deg); }
    20%, 40%, 60%, 80% { transform: rotate(-15deg); }
}

/* ============================================
   NOTIFICATION PANEL/DRAWER
   ============================================ */

.notification-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    background: var(--bg-primary, #0a0a0f);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.notification-panel.open {
    transform: translateX(0);
}

/* Overlay background */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notification-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Panel Header */
.notification-panel-header {
    position: sticky;
    top: 0;
    background: var(--bg-secondary, #12121a);
    padding: 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-panel-title-icon {
    font-size: 1.5rem;
}

.notification-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #a0a0b0);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close-btn:hover {
    color: var(--text-primary, #ffffff);
}

.notification-mark-all-btn {
    background: transparent;
    border: 1px solid var(--squizito-lime, #b3f400);
    color: var(--squizito-lime, #b3f400);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notification-mark-all-btn:hover {
    background: rgba(179, 244, 0, 0.1);
}

.notification-mark-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Category Filter Tabs */
.notification-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem;
    background: var(--bg-primary, #0a0a0f);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none;
}

.notification-filters::-webkit-scrollbar {
    display: none;
}

.notification-filter-tab {
    background: var(--bg-tertiary, #1a1a24);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #a0a0b0);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.notification-filter-tab:hover {
    background: var(--bg-hover, #22222e);
    border-color: rgba(179, 244, 0, 0.3);
}

.notification-filter-tab.active {
    background: var(--squizito-lime, #b3f400);
    border-color: var(--squizito-lime, #b3f400);
    color: var(--bg-primary, #0a0a0f);
}

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

.notification-list-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary, #a0a0b0);
}

.notification-list-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notification-list-empty-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #ffffff);
}

.notification-list-empty-subtext {
    font-size: 0.875rem;
    color: var(--text-muted, #606070);
}

/* ============================================
   NOTIFICATION ITEM
   ============================================ */

.notification-item {
    position: relative;
    background: var(--bg-secondary, #12121a);
    border-left: 3px solid transparent;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notification-item:hover {
    background: var(--bg-tertiary, #1a1a24);
}

.notification-item.unread {
    background: rgba(179, 244, 0, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--squizito-lime, #b3f400);
    border-radius: 50%;
    margin-left: -4px;
    box-shadow: 0 0 8px rgba(179, 244, 0, 0.6);
}

/* Category colors */
.notification-item[data-category="PREDICTION"] {
    border-left-color: var(--accent-purple, #9d4edd);
}

.notification-item[data-category="CHALLENGE"] {
    border-left-color: var(--accent-cyan, #00d9ff);
}

.notification-item[data-category="ACHIEVEMENT"] {
    border-left-color: var(--coin-gold, #ffd700);
}

.notification-item[data-category="SYSTEM"] {
    border-left-color: var(--squizito-lime, #b3f400);
}

.notification-item[data-category="REWARD"] {
    border-left-color: var(--success, #b3f400);
}

.notification-item[data-category="SOCIAL"] {
    border-left-color: var(--accent-pink, #ff006e);
}

/* Icon */
.notification-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
}

.notification-icon[data-category="PREDICTION"] {
    background: rgba(157, 78, 221, 0.15);
    color: var(--accent-purple, #9d4edd);
}

.notification-icon[data-category="CHALLENGE"] {
    background: rgba(0, 217, 255, 0.15);
    color: var(--accent-cyan, #00d9ff);
}

.notification-icon[data-category="ACHIEVEMENT"] {
    background: rgba(255, 215, 0, 0.15);
    color: var(--coin-gold, #ffd700);
}

.notification-icon[data-category="SYSTEM"] {
    background: rgba(179, 244, 0, 0.15);
    color: var(--squizito-lime, #b3f400);
}

.notification-icon[data-category="REWARD"] {
    background: rgba(179, 244, 0, 0.15);
    color: var(--success, #b3f400);
}

.notification-icon[data-category="SOCIAL"] {
    background: rgba(255, 0, 110, 0.15);
    color: var(--accent-pink, #ff006e);
}

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

.notification-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-item.unread .notification-title {
    font-weight: 700;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted, #606070);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notification-time-icon {
    font-size: 0.875rem;
}

/* Swipe to mark read (mobile) */
.notification-item.swiping {
    transform: translateX(-80px);
    transition: transform 0.3s ease;
}

.notification-swipe-action {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: var(--success, #b3f400);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary, #0a0a0f);
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-item.swiping .notification-swipe-action {
    opacity: 1;
}

/* ============================================
   LOAD MORE BUTTON
   ============================================ */

.notification-load-more {
    padding: 1rem;
    text-align: center;
}

.notification-load-more-btn {
    background: transparent;
    border: 1px solid rgba(179, 244, 0, 0.3);
    color: var(--squizito-lime, #b3f400);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 300px;
}

.notification-load-more-btn:hover {
    background: rgba(179, 244, 0, 0.1);
    border-color: var(--squizito-lime, #b3f400);
}

.notification-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading spinner */
.notification-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary, #a0a0b0);
}

.notification-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(179, 244, 0, 0.2);
    border-top-color: var(--squizito-lime, #b3f400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.notification-toast {
    position: fixed;
    top: 80px;
    right: 1rem;
    background: var(--bg-secondary, #12121a);
    color: var(--text-primary, #ffffff);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(179, 244, 0, 0.2);
    z-index: 10000;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

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

.notification-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-toast-content {
    flex: 1;
    min-width: 0;
}

.notification-toast-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toast variants */
.notification-toast.high-priority {
    border-left: 4px solid var(--danger, #ff3366);
    animation: toastPulse 2s ease-in-out infinite;
}

@keyframes toastPulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 51, 102, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 51, 102, 0.6);
    }
}

/* ============================================
   DESKTOP STYLES (min-width: 768px)
   ============================================ */

@media (min-width: 768px) {
    /* Panel becomes dropdown */
    .notification-panel {
        top: 60px;
        right: 1rem;
        bottom: auto;
        width: 420px;
        max-width: 420px;
        max-height: 600px;
        border-radius: var(--radius-lg, 16px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        transform: translateY(-10px);
        opacity: 0;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .notification-panel.open {
        transform: translateY(0);
        opacity: 1;
    }

    /* Hide overlay on desktop */
    .notification-overlay {
        display: none;
    }

    /* Adjust header */
    .notification-panel-header {
        padding: 1rem 1.25rem;
    }

    .notification-close-btn {
        display: none;
    }

    /* Filters */
    .notification-filters {
        padding: 0.75rem 1rem;
    }

    /* Items */
    .notification-item {
        padding: 0.875rem 1.25rem;
    }
}

/* ============================================
   DESKTOP LARGE (min-width: 1024px)
   ============================================ */

@media (min-width: 1024px) {
    .notification-panel {
        width: 480px;
        max-width: 480px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.notification-hidden {
    display: none !important;
}

.notification-no-scroll {
    overflow: hidden;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .notification-panel,
    .notification-toast,
    .notification-badge,
    .notification-bell-icon {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visible for keyboard navigation */
.notification-bell-container:focus-visible,
.notification-filter-tab:focus-visible,
.notification-item:focus-visible,
.notification-mark-all-btn:focus-visible,
.notification-close-btn:focus-visible,
.notification-load-more-btn:focus-visible {
    outline: 2px solid var(--squizito-lime, #b3f400);
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
