/* ========================================
   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;
    }
}

/* ============================================================
   ACTION CENTER FLYOUT — Phase 2
   Feature: RentBot Action Center
   Z-index ladder:
     Page content:       auto
     Bootstrap navbar:   1030
     Overlay:            1049
     Flyout panel:       1050
     Bootstrap modals:   1055 (safe — Action Center sits below modals)
   ============================================================ */

/* --- Action Center Badge --- */
.action-center-badge {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    color: #FFFFFF;
    font-weight: 600;
}

.action-center-badge.updating {
    animation: badge-bounce 0.4s ease-out;
}

/* --- Action Center Flyout Container --- */
.action-center-flyout {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1049;
}

/* --- Action Center Overlay --- */
.action-center-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1049;
    transition: background-color 0.3s ease;
}

.action-center-flyout.open .action-center-overlay {
    background-color: rgba(0, 0, 0, 0.3);
}

/* --- Action Center Panel --- */
.action-center-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: #FFFFFF;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.action-center-flyout.open .action-center-panel {
    right: 0;
}

/* --- Action Center Header --- */
.action-center-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.action-center-header h5 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

/* --- Action Center Scrollable Body --- */
.action-center-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* --- Action Cards (shared) --- */
.action-card {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    padding: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.action-card:last-child {
    border-bottom: none;
}

.action-card-severity-bar {
    width: 4px;
    flex-shrink: 0;
    min-height: 100%;
}

.action-card-content {
    flex: 1;
    padding: 16px 20px;
    min-width: 0;
}

.action-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.action-card-timestamp {
    font-size: 0.75rem;
    color: #757575;
}

.action-card-contact {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card-excerpt {
    font-size: 0.8125rem;
    color: #616161;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.action-card-question {
    font-size: 0.8125rem;
    color: #212529;
    font-style: italic;
    margin-bottom: 8px;
}

/* --- Action Card Actions Row --- */
.action-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.action-card-actions .btn-sm {
    font-size: 0.8125rem;
    padding: 4px 12px;
}

/* --- Action Card Dismiss Flow --- */
.action-card-dismiss {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.action-card-dismiss select {
    font-size: 0.8125rem;
}

.action-card-dismiss .dismiss-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* --- Action Card Knowledge Gap Form --- */
.action-card-knowledge-form {
    margin-top: 12px;
}

.action-card-knowledge-form textarea {
    font-size: 0.8125rem;
    resize: vertical;
    min-height: 60px;
}

.action-card-knowledge-form .char-counter {
    font-size: 0.6875rem;
    text-align: right;
    margin-top: 2px;
}

.action-card-knowledge-form .form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

/* --- Flyout States --- */
.action-center-loading,
.action-center-empty,
.action-center-error {
    padding: 48px 24px;
    text-align: center;
}

.action-center-empty i,
.action-center-error i {
    display: block;
    margin: 0 auto 16px;
}

/* --- Load More Button --- */
#actionLoadMore .btn-link {
    font-size: 0.8125rem;
    text-decoration: none;
}

#actionLoadMore .btn-link:hover {
    text-decoration: underline;
}

/* --- Responsive: Tablet --- */
@media (max-width: 991px) {
    .action-center-panel {
        width: 360px;
        right: -360px;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 575px) {
    .action-center-panel {
        width: 100%;
        right: -100%;
    }

    .action-card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .action-card-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Reduced Motion for Action Center --- */
@media (prefers-reduced-motion: reduce) {
    .action-center-panel,
    .action-center-overlay,
    .action-card,
    .action-center-badge {
        animation: none !important;
        transition: none !important;
    }

    .action-center-flyout.open .action-center-panel {
        right: 0;
    }
}
