/* ==========================================
   NOTIFICATION BELL
   ========================================== */
.notification-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary, #64748b);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-bell-btn:hover {
    color: var(--primary-color, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger-color, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    animation: notification-badge-pop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes notification-badge-pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==========================================
   NOTIFICATION DROPDOWN
   ========================================== */
.notification-dropdown {
    position: fixed;
    width: 360px;
    max-height: 460px;
    background: var(--card-background, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--border-radius-lg, 16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    overflow: hidden;
    animation: dropdown-slide-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdown-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.notification-dropdown-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary, #1e293b);
    letter-spacing: -0.01em;
}

.notification-mark-all {
    background: none;
    border: none;
    color: var(--primary-color, #6366f1);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.notification-mark-all:hover {
    background: rgba(99, 102, 241, 0.08);
}

.notification-clear-all {
    background: none;
    border: none;
    color: var(--danger-color, #ef4444);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.notification-clear-all:hover {
    background: rgba(239, 68, 68, 0.08);
}

.notification-close-btn {
    background: none;
    border: none;
    color: var(--text-light, #94a3b8);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
    margin-left: 8px;
    line-height: 1;
}

.notification-close-btn:hover {
    color: var(--text-primary, #1e293b);
    background: rgba(0, 0, 0, 0.06);
}

.notification-dismiss-btn {
    background: none;
    border: none;
    color: var(--text-light, #94a3b8);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    opacity: 0;
}

.notification-item:hover .notification-dismiss-btn {
    opacity: 1;
}

@media (max-width: 768px) {
    .notification-dismiss-btn {
        opacity: 1;
    }
}

.notification-dismiss-btn:hover {
    color: var(--danger-color, #ef4444);
    background: rgba(239, 68, 68, 0.08);
}

.notification-achievement-link {
    color: var(--primary-color, #6366f1);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s ease;
}

.notification-achievement-link:hover {
    text-decoration-color: var(--primary-color, #6366f1);
}

.notification-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-dropdown-list {
    max-height: 390px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notification-dropdown-list::-webkit-scrollbar {
    width: 4px;
}

.notification-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--border-color, #e2e8f0);
    border-radius: 4px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.06);
    border-left: 3px solid var(--primary-color, #6366f1);
    padding-left: 17px;
}

.notification-item.unread .notification-item-title {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.notification-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

/* Icon color variants per notification type */
.notification-item-icon.icon-reaction {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-item-icon.icon-friend_request {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color, #6366f1);
}

.notification-item-icon.icon-friend_accepted {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
}

.notification-item-icon.icon-group_invite {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.notification-item-icon.icon-achievement {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color, #f59e0b);
}

.notification-item-icon.icon-default {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color, #64748b);
}

.notification-item-body {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-size: 13px;
    color: var(--text-primary, #1e293b);
    line-height: 1.4;
    word-break: break-word;
}

.notification-item-detail {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin-top: 2px;
    line-height: 1.3;
}

.notification-item-time {
    font-size: 11px;
    color: var(--text-light, #94a3b8);
    margin-top: 4px;
}

.notification-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-light, #94a3b8);
    font-size: 14px;
}

.notification-empty::before {
    content: '\f0f3';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ==========================================
   MOBILE RESPONSIVE — NOTIFICATIONS
   ========================================== */
@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed;
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 80vh;
        border-radius: 0 0 16px 16px;
        border-top: none;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        animation: dropdown-slide-down 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes dropdown-slide-down {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .notification-dropdown-header {
        padding: 16px 20px 12px;
    }

    /* Remove bottom-sheet drag handle */
    .notification-dropdown-header::before {
        display: none;
    }

    .notification-dropdown-title {
        font-size: 17px;
    }

    .notification-dropdown-list {
        max-height: calc(80vh - 56px);
    }

    .notification-item {
        padding: 16px 20px;
    }
}

/* Overlay behind mobile dropdown */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    animation: overlay-fade-in 0.2s ease;
}

@keyframes overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
