/* ============================================
   MbDashboard Notification Styles
   ============================================ */

/* Bell Icon & Badge */
.notification-bell-wrapper {
    position: relative;
    cursor: pointer;
}

.notification-bell {
    font-size: 1.25rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.notification-bell:hover {
    color: #6366f1;
}

.notification-badge {
    position: absolute;
    top: 3px;
    right: 7px;
    min-width: 15px;
    height: 15px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    overflow: hidden;
    display: none;
}

.notification-dropdown.show {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.notification-dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
}

.notification-dropdown-header .mark-all-read {
    font-size: 0.8rem;
    color: #6366f1;
    cursor: pointer;
    transition: color 0.2s;
}

.notification-dropdown-header .mark-all-read:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.notification-dropdown-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-dropdown-list::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 3px;
}

.notification-dropdown-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.notification-dropdown-footer a {
    font-size: 0.85rem;
    color: #6366f1;
    text-decoration: none;
}

.notification-dropdown-footer a:hover {
    text-decoration: underline;
}

/* Notification Item */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: #f9fafb;
}

.notification-item.unread {
    background-color: #f0f4ff;
}

.notification-item.unread:hover {
    background-color: #e8edff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notification-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.notification-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon.secondary {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.notification-icon.dark {
    background: rgba(31, 41, 55, 0.1);
    color: #1f2937;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
    line-height: 1.3;
}

.notification-message {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 4px;
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
}

/* Empty State */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
}

.notification-empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.notification-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Toast Notifications */
.notification-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease;
    border-left: 4px solid #6366f1;
}

.notification-toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.notification-toast.success {
    border-left-color: #22c55e;
}

.notification-toast.warning {
    border-left-color: #f59e0b;
}

.notification-toast.danger {
    border-left-color: #ef4444;
}

.notification-toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.notification-toast.success .toast-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.notification-toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-toast.danger .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Connection Status Indicator */
.connection-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.connection-status.connected {
    background: #22c55e;
}

.connection-status.reconnecting {
    background: #f59e0b;
    animation: statusPulse 1s infinite;
}

.connection-status.disconnected,
.connection-status.error {
    background: #ef4444;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Notification Page */
.notification-page-container {
    max-width: 800px;
    margin: 0 auto;
}

.notification-page-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    cursor: pointer;
}

.notification-page-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.notification-page-item.unread {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, #fff 100%);
    border-left: 3px solid #6366f1;
}

.notification-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-page-content {
    flex: 1;
}

.notification-page-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.notification-page-message {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 8px;
}

.notification-page-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: #9ca3af;
}

.notification-page-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.notification-page-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-page-actions .btn-read {
    background: #f3f4f6;
    color: #6b7280;
}

.notification-page-actions .btn-read:hover {
    background: #e5e7eb;
}

.notification-page-actions .btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-page-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .notification-dropdown {
        width: 100%;
        right: 0;
        left: 0;
        margin: 0 10px;
        max-width: calc(100% - 20px);
    }

    .notification-toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .notification-toast {
        width: 100%;
    }
}
