/* ============================================
   NOTIFICATION CENTER
   Professional notification system UI
   Version: 2.22
   Date: January 14, 2026
   ============================================ */

/* Notification Icon (in header) */
.notification-icon-wrapper {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-icon-wrapper:hover {
    background: rgba(102, 126, 234, 0.1);
}

.notification-icon-wrapper:active {
    transform: scale(0.95);
}

#notification-icon {
    font-size: 24px;
    color: #667eea;
    transition: all 0.2s ease;
}

#notification-icon.has-notifications {
    animation: bellRing 2s ease infinite;
}

/* Notification Badge */
#notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse 2s ease infinite;
}

/* Notification Overlay */
#notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#notification-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Notification Panel */
#notification-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    max-width: 100%;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#notification-panel.open {
    right: 0;
}

/* Panel Header */
.notification-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.notification-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.notification-panel-title i {
    font-size: 20px;
}

#notification-panel-count {
    font-size: 14px;
    opacity: 0.9;
}

.notification-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.notification-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.notification-panel-close:active {
    transform: scale(0.9) rotate(90deg);
}

/* Panel Actions */
.notification-panel-actions {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.notification-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.notification-action-btn:hover {
    background: #f9fafb;
    border-color: #667eea;
    color: #667eea;
}

.notification-action-btn:active {
    transform: scale(0.98);
}

.notification-action-btn i {
    font-size: 12px;
}

/* Notification List Container */
.notification-panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#notification-list {
    padding: 8px;
}

/* Empty State */
#notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

#notification-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

#notification-empty p {
    font-size: 15px;
    margin-bottom: 4px;
}

#notification-empty small {
    font-size: 13px;
}

/* Notification Item */
.notification-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.notification-item:hover {
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateX(-2px);
}

.notification-item.unread {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #667eea;
    border-radius: 0 4px 4px 0;
}

.notification-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-item.unread .notification-icon {
    background: #dbeafe;
}

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

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-body {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 11px;
    color: #9ca3af;
}

.notification-delete {
    background: transparent;
    border: none;
    color: #9ca3af;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-item:hover .notification-delete {
    opacity: 1;
}

.notification-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.notification-delete:active {
    transform: scale(0.9);
}

/* Scrollbar Styling */
.notification-panel-content::-webkit-scrollbar {
    width: 6px;
}

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

.notification-panel-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.notification-panel-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
    background: #10b981;
}

.toast.toast-warning {
    background: #f59e0b;
}

.toast.toast-error {
    background: #ef4444;
}

/* Animations */
@keyframes bellRing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Dark Theme Support */
body.dark-theme #notification-panel {
    background: #1f2937;
}

body.dark-theme .notification-panel-actions {
    border-bottom-color: #374151;
}

body.dark-theme .notification-action-btn {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

body.dark-theme .notification-action-btn:hover {
    background: #4b5563;
    border-color: #818cf8;
    color: #818cf8;
}

body.dark-theme .notification-item {
    background: #374151;
    border-color: #4b5563;
}

body.dark-theme .notification-item:hover {
    background: #4b5563;
}

body.dark-theme .notification-item.unread {
    background: #1e3a5f;
    border-color: #3b82f6;
}

body.dark-theme .notification-icon {
    background: #4b5563;
}

body.dark-theme .notification-item.unread .notification-icon {
    background: #1e40af;
}

body.dark-theme .notification-title {
    color: #f3f4f6;
}

body.dark-theme .notification-body {
    color: #d1d5db;
}

body.dark-theme .notification-time {
    color: #9ca3af;
}

body.dark-theme .notification-delete:hover {
    background: #7f1d1d;
    color: #fca5a5;
}

body.dark-theme #notification-empty {
    color: #6b7280;
}

body.dark-theme .notification-panel-content::-webkit-scrollbar-thumb {
    background: #4b5563;
}

body.dark-theme .notification-panel-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    #notification-panel {
        width: 100%;
        right: -100%;
    }

    .notification-panel-header {
        padding: 16px;
    }

    .notification-panel-title {
        font-size: 16px;
    }

    .notification-panel-actions {
        padding: 10px 16px;
    }

    #notification-list {
        padding: 8px 12px;
    }

    .notification-item {
        padding: 10px;
    }

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

    .toast {
        bottom: 70px;
        max-width: 85%;
    }
}

/* Notification Permission Banner */
.notification-permission-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    margin: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.notification-permission-banner i {
    font-size: 28px;
    flex-shrink: 0;
}

.notification-permission-content {
    flex: 1;
}

.notification-permission-content h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
}

.notification-permission-content p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.notification-permission-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.notification-permission-btn:hover {
    background: #f3f4f6;
    transform: scale(1.05);
}

.notification-permission-btn:active {
    transform: scale(0.98);
}
