/* static/crm/css/notification.css */

/* Notification Wrapper */
.notification-wrapper {
    position: relative;
    display: inline-block;
}

.notification-toggle {
    padding: 8px 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s;
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-toggle .fa-bell {
    font-size: 20px;
}

.notification-badge {
    font-size: 10px;
    padding: 3px 7px;
    min-width: 20px;
    animation: none;
    transform: translate(0, -5px);
}

.notification-badge.bounce {
    animation: bellBounce 0.5s ease;
}

@keyframes bellBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    80% { transform: scale(1.1); }
}

/* Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    width: 400px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
    z-index: 1050;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.notification-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    background: #fafbfc;
}

.notification-header h6 {
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.notification-header .btn-link {
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    padding: 0;
}

.notification-header .btn-link:hover {
    color: #5a6fd6;
    text-decoration: underline;
}

/* List */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.notification-list::-webkit-scrollbar {
    width: 4px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

/* Items */
.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.notification-item:hover {
    background: #f8f9ff;
}

.notification-item.unread {
    background: #f0f4ff;
    border-left: 3px solid #667eea;
}

.notification-item.read {
    opacity: 0.7;
}

.notification-item .notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 14px;
}

.notification-item .notification-icon.text-primary {
    background: #e8eeff;
    color: #667eea;
}

.notification-item .notification-icon.text-success {
    background: #e8f5e9;
    color: #28a745;
}

.notification-item .notification-icon.text-danger {
    background: #ffebee;
    color: #dc3545;
}

.notification-item .notification-icon.text-info {
    background: #e3f2fd;
    color: #0dcaf0;
}

.notification-item .notification-icon.text-warning {
    background: #fff3cd;
    color: #ffc107;
}

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

.notification-item .notification-content .notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.notification-item .notification-content .notification-message {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-item .notification-content .notification-time {
    font-size: 11px;
    color: #adb5bd;
}

.notification-item .notification-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    flex-shrink: 0;
    margin-top: 8px;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

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

.notification-item.read .notification-badge-dot {
    display: none;
}

/* Empty state */
.notification-empty {
    text-align: center;
    padding: 30px 20px;
}

.notification-empty i {
    color: #e9ecef;
    font-size: 48px;
    margin-bottom: 12px;
}

.notification-empty p {
    color: #6c757d;
    margin: 0;
}

/* Footer */
.notification-footer {
    padding: 8px 16px;
    border-top: 1px solid #f0f2f5;
    background: #fafbfc;
}

.notification-footer kbd {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Toast Notification */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 400px;
    z-index: 9999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    border-left: 4px solid #667eea;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
}

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

.notification-toast .toast-content {
    display: flex;
    align-items: center;
}

.notification-toast .toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.notification-toast .toast-icon.primary {
    background: #e8eeff;
    color: #667eea;
}

.notification-toast .toast-icon.success {
    background: #e8f5e9;
    color: #28a745;
}

.notification-toast .toast-icon.danger {
    background: #ffebee;
    color: #dc3545;
}

.notification-toast .toast-icon.info {
    background: #e3f2fd;
    color: #0dcaf0;
}

.notification-toast .toast-icon.warning {
    background: #fff3cd;
    color: #ffc107;
}

.notification-toast .toast-text {
    flex: 1;
}

.notification-toast .toast-text .toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
}

.notification-toast .toast-text .toast-message {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: -10px;
        max-height: 400px;
    }
    
    .notification-toast {
        max-width: calc(100vw - 40px);
        right: 10px;
        top: 70px;
    }
}