﻿/* Notification System Styles
 * Extracted from assets/js/notifications.js - insertStyles()
 */

.notification-bell {
    position: relative;
    margin-right: 1rem;
}
.notification-bell-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text-dark, #1f2937);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notification-bell-btn:hover {
    background: rgba(106, 176, 184, 0.15);
    transform: scale(1.1);
}
.notification-bell-btn svg {
    transition: transform 0.3s ease;
}
.notification-bell.has-notifications .notification-bell-btn svg {
    animation: bellRing 2s ease-in-out infinite;
}
.notification-bell.has-notifications .notification-bell-btn {
    color: #e67e73;
}
@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    5% { transform: rotate(15deg); }
    10% { transform: rotate(-15deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(5deg); }
    30%, 100% { transform: rotate(0deg); }
}

.notification-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: linear-gradient(135deg, #ff6b6b 0%, #e67e73 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(230, 126, 115, 0.6), 0 0 0 2px white;
    animation: badgePop 0.3s ease-out, badgeGlow 2s ease-in-out infinite;
}
.notification-badge.hidden {
    display: none;
}
@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 2px 8px rgba(230, 126, 115, 0.6), 0 0 0 2px white; }
    50% { box-shadow: 0 2px 16px rgba(230, 126, 115, 0.9), 0 0 0 2px white, 0 0 20px rgba(230, 126, 115, 0.4); }
}

.notification-panel {
    position: fixed;
    top: 70px;
    right: 1rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    overflow: hidden;
    animation: panelSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.notification-panel.hidden {
    display: none;
}
@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(249,250,251,0.8) 100%);
}
.notification-panel-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toast Notification Styles */
.notification-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    color: #1f2937;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    border: 1px solid rgba(0,0,0,0.05);
}
.notification-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.notification-toast.success { border-left: 4px solid #10b981; }
.notification-toast.error { border-left: 4px solid #ef4444; }
.notification-toast.info { border-left: 4px solid #3b82f6; }
.notification-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
.notification-toast.success .notification-toast-icon { color: #10b981; }
.notification-toast.error .notification-toast-icon { color: #ef4444; }
.notification-toast.info .notification-toast-icon { color: #3b82f6; }

/* -- Push notification permission prompt banner -- */
#push-prompt-banner {
    position: fixed;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(480px, calc(100vw - 2rem));
    transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#push-prompt-banner.push-prompt-visible {
    bottom: 1.25rem;
}
body.push-prompt-open {
    padding-bottom: 90px;
    transition: padding-bottom 0.4s ease;
}
.push-prompt-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #1f2937;
    color: #fff;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.push-prompt-bell {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.push-prompt-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.3;
    font-size: 0.85rem;
}
.push-prompt-text strong {
    font-size: 0.9rem;
    color: #fff;
}
.push-prompt-text span {
    color: #9ca3af;
}
.push-prompt-enable {
    flex-shrink: 0;
    background: #e67e73;
    color: #fff;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
}
.push-prompt-enable:hover { background: #d96b61; }
.push-prompt-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.2s;
}
.push-prompt-close:hover { color: #fff; }
.notification-panel-header h3::before {
    content: '\1F514';
    font-size: 1.2rem;
}
.notification-panel-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    color: #9ca3af;
    border-radius: 8px;
    transition: all 0.15s;
}
.notification-panel-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1f2937;
    transform: rotate(90deg);
}

.notification-panel-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}
.notification-panel-body::-webkit-scrollbar {
    width: 6px;
}
.notification-panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.notification-panel-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.notification-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    margin: 0.375rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(249,250,251,0.9) 100%);
    border: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(106, 176, 184, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.notification-item:hover {
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}
.notification-item:hover::before {
    opacity: 1;
}
.notification-item.urgency-urgent {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.7) 0%, rgba(255, 255, 255, 0.95) 100%);
    animation: urgentPulse 2s ease-in-out infinite;
}
@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.notification-item.urgency-high {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.6) 0%, rgba(255, 255, 255, 0.95) 100%);
}
.notification-item.urgency-medium {
    border-left: 4px solid #6ab0b8;
}
.notification-item.urgency-low {
    border-left: 4px solid #d1d5db;
}

.notification-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(106, 176, 184, 0.1);
    border-radius: 12px;
}
.notification-item.urgency-urgent .notification-icon {
    background: rgba(239, 68, 68, 0.1);
}
.notification-item.urgency-high .notification-icon {
    background: rgba(245, 158, 11, 0.1);
}
.notification-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.notification-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.notification-message {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.notification-date {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.notification-date::before {
    content: '\1F550';
    font-size: 0.7rem;
}
.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    position: relative;
    z-index: 2;
}
.notification-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notification-action-btn.primary {
    background: linear-gradient(135deg, #6ab0b8 0%, #4a9da5 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(106, 176, 184, 0.4);
}
.notification-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 176, 184, 0.5);
}
.notification-action-btn.secondary {
    background: rgba(0, 0, 0, 0.04);
    color: #6b7280;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.notification-action-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #374151;
}
.notification-action-btn.dismiss-btn {
    background: transparent;
    color: #9ca3af;
    padding: 0.35rem 0.5rem;
    min-width: auto;
    font-size: 0.9rem;
    border: none;
}
.notification-action-btn.dismiss-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.purchase-notif {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(106, 176, 184, 0.05) 100%);
    border-left: 3px solid #22c55e;
    /* Make purchase notifications more compact */
    padding: 0.75rem 0.8rem;
    gap: 0.65rem;
    margin: 0.3rem;
    border-radius: 12px;
}
.purchase-notif .notification-icon {
    font-size: 1.15rem;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}
.purchase-notif .notification-title {
    color: #22c55e;
    font-size: 0.85rem;
}
.purchase-notif .notification-message {
    font-size: 0.75rem;
}
.purchase-notif .notification-date {
    font-size: 0.7rem;
}
.purchase-notif .notification-action-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    border-radius: 10px;
}
.purchase-notif .notification-action-btn.dismiss-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}

.notification-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #9ca3af;
}
.notification-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.6;
    animation: emptyBounce 2s ease-in-out infinite;
}
@keyframes emptyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.notification-empty p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.notification-panel-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(249,250,251,0.9) 0%, rgba(255,255,255,1) 100%);
}
.notification-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6ab0b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1rem;
    border-radius: 10px;
    transition: all 0.2s;
    background: rgba(106, 176, 184, 0.08);
}
.notification-view-all:hover {
    background: rgba(106, 176, 184, 0.15);
    color: #4a9da5;
    transform: translateY(-1px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .notification-panel {
        top: 60px;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
    }
    .notification-bell {
        margin-right: 0.5rem;
    }
}

/* Notification Tabs */
.notification-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(249, 250, 251, 0.5);
}
.notification-tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    position: relative;
    transition: all 0.2s;
}
.notification-tab-btn:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.03);
}
.notification-tab-btn.active {
    color: #e67e73;
}
.notification-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e67e73;
}
.notification-tab-badge {
    display: inline-block;
    background: #e67e73;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 99px;
    text-align: center;
    margin-left: 0.375rem;
}

/* History Items */
.notification-history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    margin: 0.25rem;
    border-radius: 12px;
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.04);
    opacity: 0.8;
}
.notification-history-item .notification-icon {
    font-size: 1.25rem;
    opacity: 0.6;
}
.notification-history-item .notification-message {
    font-size: 0.8rem;
    color: #6b7280;
}
.notification-history-item .notification-date {
    font-size: 0.7rem;
}

/* History item expand icon */
.history-expand-icon {
    font-size: 1.25rem;
    color: #9ca3af;
    font-weight: 300;
    transition: transform 0.2s, color 0.2s;
    align-self: center;
}
.notification-item.history-item:hover .history-expand-icon {
    transform: translateX(3px);
    color: #6ab0b8;
}

/* History Detail Modal */
.notification-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.notification-detail-modal.active {
    opacity: 1;
}
.notification-detail-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.notification-detail-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.notification-detail-modal.active .notification-detail-content {
    transform: scale(1) translateY(0);
}
.notification-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
}
.notification-detail-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
    transform: rotate(90deg);
}
.notification-detail-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}
.notification-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.notification-detail-message {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.notification-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    color: #9ca3af;
    font-size: 0.85rem;
}
.notification-detail-time {
    color: #6b7280;
}
.notification-detail-ago {
    font-size: 0.8rem;
}
.notification-detail-dismiss {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.notification-detail-dismiss:hover {
    background: rgba(239, 68, 68, 0.2);
}
.notification-detail-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.notification-detail-view {
    background: linear-gradient(135deg, #6ab0b8 0%, #4a9da5 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.notification-detail-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 176, 184, 0.4);
}
.notification-detail-receipt {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.notification-detail-receipt:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
    transform: translateY(-2px);
}
.notification-detail-order {
    display: inline-block;
    background: rgba(106, 176, 184, 0.1);
    color: #4a9da5;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.notification-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.5rem;
}

/* Purchase Toast Notification */
.notification-toast.purchase-toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    left: auto;
    z-index: 10002;
    transform: translateY(60px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.notification-toast.purchase-toast.active {
    transform: translateY(0);
    opacity: 1;
}
.notification-toast.purchase-toast .notification-toast-content {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: white;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 300px;
}
.notification-toast.purchase-toast .notification-toast-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    line-height: 1;
}
.notification-toast.purchase-toast .notification-toast-body {
    flex: 1;
    min-width: 0;
}
.notification-toast.purchase-toast .notification-toast-title {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.82rem;
    margin-bottom: 0.05rem;
}
.notification-toast.purchase-toast .notification-toast-message {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notification-toast.purchase-toast .notification-toast-action {
    background: linear-gradient(135deg, #6ab0b8 0%, #4a9da5 100%);
    color: white;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s;
}
.notification-toast.purchase-toast .notification-toast-action:hover {
    transform: scale(1.05);
}
@media (max-width: 480px) {
    .notification-toast.purchase-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    .notification-toast.purchase-toast .notification-toast-content {
        max-width: none;
    }
}

/* System notification specific */
.notification-item.system-notification {
    background: linear-gradient(90deg, rgba(106, 176, 184, 0.1) 0%, rgba(255, 255, 255, 0.8) 100%);
}
.notification-item.system-notification.urgency-urgent {
    background: linear-gradient(90deg, rgba(254, 226, 226, 0.5) 0%, rgba(255, 255, 255, 0.8) 100%);
}
.notification-item.system-notification.urgency-important {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.5) 0%, rgba(255, 255, 255, 0.8) 100%);
}
