/**
 * Notification Center Styles
 *
 * Styles for notification bell, dropdown, and toast notifications
 */

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--main-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: badge-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* Notification Dropdown */
.notification-dropdown {
    position: fixed;
    width: 380px;
    max-height: 500px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

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

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

.notification-header h6 {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    margin: 0;
}

.btn-mark-all-read {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-mark-all-read:hover {
    background: rgba(126, 58, 242, 0.1);
}

/* Notification Body */
.notification-body {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

/* Custom scrollbar for notification list */
.notification-body::-webkit-scrollbar {
    width: 6px;
}

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

.notification-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.notification-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Notification Item */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--hover-bg);
}

.notification-item.unread {
    background: rgba(126, 58, 242, 0.05);
}

.notification-item.unread:hover {
    background: rgba(126, 58, 242, 0.1);
}

/* Notification Icon */
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-message {
    font-size: 0.813rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Unread Dot Indicator */
.notification-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.view-all-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: var(--accent-hover);
}

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

.empty-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notification-empty p,
.notification-error p {
    font-size: 0.875rem;
    margin: 0;
}

.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* Toast Notifications */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

/* Toast Types */
.notification-toast.toast-success {
    border-left: 4px solid #10b981;
}

.notification-toast.toast-error {
    border-left: 4px solid #ef4444;
}

.notification-toast.toast-warning {
    border-left: 4px solid #fbbf24;
}

.notification-toast.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .notification-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 70vh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
    }

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

    .notification-toast {
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* Dark Mode Specific */
[data-theme="dark"] .notification-dropdown {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .notification-toast {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .notification-item.unread {
    background: rgba(126, 58, 242, 0.08);
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Loading Spinner */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.15em;
}

/* Accessibility */
.notification-item:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.btn-mark-all-read:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .notification-dropdown,
    .notification-toast,
    #notificationBell {
        display: none !important;
    }
}
