/* ========================================
   Notification System Styles
   Customer Notification System - Phase 1
   ======================================== */

/* --- Notification Badge --- */
.notification-count {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 4px;
    border-radius: 9px;
}

.notification-count.updating {
    animation: badge-bounce 0.4s ease-out;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* --- Urgency Styling --- */
.rentsabiNotification.urgency-critical,
.rentsabiNotification.urgency-high {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.rentsabiNotification.urgency-critical .notification-urgency-icon,
.rentsabiNotification.urgency-high .notification-urgency-icon {
    color: #dc3545;
}

.rentsabiNotification.urgency-critical {
    animation: urgent-pulse 2s ease-in-out infinite;
}

@keyframes urgent-pulse {
    0%, 100% { border-left-width: 4px; }
    50% { border-left-width: 6px; }
}

.rentsabiNotification.urgency-medium {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.rentsabiNotification.urgency-medium .notification-urgency-icon {
    color: #ffc107;
}

.rentsabiNotification.urgency-low {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.rentsabiNotification.urgency-low .notification-urgency-icon {
    color: #17a2b8;
}

/* --- Notification Interactive States --- */
.notification-dismiss:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.notification-resolve:hover,
.notification-resolve-offline:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.rentsabiNotification.resolving {
    opacity: 0.6;
    pointer-events: none;
}

.rentsabiNotification.resolving::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #007bff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Notification Animations --- */
.rentsabiNotification.entering {
    animation: slideInFade 0.3s ease-out;
}

@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rentsabiNotification.exiting {
    animation: slideOutFade 0.3s ease-in forwards;
}

@keyframes slideOutFade {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* --- Message Action Indicators --- */
.message-action-indicator {
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    padding: 4px 0;
}

.message-action-indicator:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
    padding: 4px 8px;
}

.message-action-indicator:hover .action-label {
    color: #007bff;
    font-weight: 600;
}

.action-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.action-dot.urgency-high,
.action-dot.urgency-critical {
    background-color: #dc3545;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.5);
    animation: dot-pulse 2s ease-in-out infinite;
}

.action-dot.urgency-medium {
    background-color: #ffc107;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.5);
    animation: dot-pulse 2s ease-in-out infinite;
}

.action-dot.urgency-low {
    background-color: #17a2b8;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* --- Action Item States --- */
.action-item {
    border-left: 4px solid #17a2b8;
    transition: all 0.3s ease;
}

.action-item.resolved {
    opacity: 0.6;
    border-left-color: #28a745;
}

.action-item.resolved .action-description,
.action-item.resolved .action-details {
    text-decoration: line-through;
}

.action-item.resolved .action-buttons {
    display: none;
}

.action-item.resolved .action-resolved {
    display: block !important;
}

.action-item.resolving {
    opacity: 0.5;
    pointer-events: none;
}

.action-item.resolving .action-buttons {
    position: relative;
}

.action-item.resolving .action-buttons::after {
    content: 'Resolving...';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    color: #007bff;
}

/* --- Bell Icon Animation --- */
@keyframes bell-ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

.notification-bell-active {
    animation: bell-ring 2s ease-in-out infinite;
}

/* --- Responsive Design --- */
@media (max-width: 767px) {
    .rentsabiNotification .d-flex {
        flex-direction: column;
    }

    .rentsabiNotification .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .rentsabiNotification .notificationDate {
        margin-left: 0 !important;
        text-align: left;
        margin-top: 8px;
    }

    .action-item .d-flex {
        flex-direction: column;
    }

    .action-item .action-buttons {
        width: 100%;
    }

    .action-item .btn {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* --- Reduced Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .rentsabiNotification,
    .notification-bell-active,
    .action-dot,
    .rentsabiNotification.entering,
    .rentsabiNotification.exiting {
        animation: none !important;
        transition: none !important;
    }
}
