/**
 * Invoice Audit Trail / Activity Log Styles
 * Enhanced visual indicators for invoice updates
 */

/* =============================================
   SELLS LIST - ROW HIGHLIGHTING
   ============================================= */

/* Highlight row for updated invoices in the sells list */
.invoice-updated-row {
    background-color: #fff8e1 !important;
    border-left: 3px solid #f39c12 !important;
}

.invoice-updated-row:hover {
    background-color: #ffecb3 !important;
}

/* Updated badge next to invoice number - Orange color like the return badge */
.label.bg-orange {
    background-color: #f39c12 !important;
    color: #fff !important;
}

.label-round {
    border-radius: 50%;
    padding: 3px 5px;
    font-size: 10px;
}

/* Light blue background color */
.bg-light-blue {
    background-color: #3c8dbc !important;
}

/* =============================================
   SELL DETAILS MODAL - ACTIVITIES SECTION
   ============================================= */

/* Enhanced Activity Log Section Container */
.enhanced-activities-section {
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.enhanced-activities-section .table {
    margin-bottom: 0;
}

.enhanced-activities-section .table thead tr {
    background-color: #f4f4f4;
}

/* Activity row base styles with left border indicator */
.activity-row {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.activity-row:hover {
    background-color: #f9f9f9;
}

/* Activity type specific border colors */
.activity-row.activity-created {
    border-left-color: #00a65a; /* Green */
}

.activity-row.activity-updated {
    border-left-color: #00c0ef; /* Light Blue */
}

.activity-row.activity-price_changed,
.activity-row.activity-qty_changed,
.activity-row.activity-discount_changed,
.activity-row.activity-line_discount_changed,
.activity-row.activity-tax_changed {
    border-left-color: #f39c12; /* Orange */
}

.activity-row.activity-item_added {
    border-left-color: #00a65a; /* Green */
}

.activity-row.activity-item_removed,
.activity-row.activity-return,
.activity-row.activity-void,
.activity-row.activity-deleted,
.activity-row.activity-payment_removed {
    border-left-color: #dd4b39; /* Red */
}

.activity-row.activity-payment_added,
.activity-row.activity-payment_updated,
.activity-row.activity-payment_method_changed {
    border-left-color: #605ca8; /* Purple */
}

.activity-row.activity-status_changed,
.activity-row.activity-shipping_changed {
    border-left-color: #00c0ef; /* Light Blue */
}

/* =============================================
   ACTIVITY BADGE STYLES
   ============================================= */

/* Purple label for payment actions */
.label-purple {
    background-color: #605ca8 !important;
}

/* Orange label for price/discount/quantity changes */
.label-orange,
.label-warning {
    background-color: #f39c12 !important;
}

/* Activity label in table */
.activity-action .label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
}

.activity-action .label i {
    font-size: 10px;
}

/* =============================================
   DIFF DETAILS SECTION
   ============================================= */

.diff-details {
    margin-top: 8px;
    font-size: 11px;
}

.diff-details .well {
    margin-bottom: 0;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.diff-details code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    padding: 6px 8px;
    margin-top: 4px;
    font-size: 10px;
    border: 1px solid #eee;
    border-radius: 3px;
    max-height: 150px;
    overflow-y: auto;
}

.diff-before,
.diff-after {
    margin-bottom: 8px;
}

.diff-before:last-child,
.diff-after:last-child {
    margin-bottom: 0;
}

.toggle-diff-details {
    font-size: 11px;
    padding: 0 5px;
    color: #3c8dbc;
}

.toggle-diff-details:hover {
    color: #2a6496;
    text-decoration: none;
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.bg-light-gray {
    background-color: #f4f4f4;
}

.bg-light-gray-active {
    background-color: #e8e8e8;
}

.activity-date small {
    color: #777;
    font-size: 11px;
}

.activity-description {
    max-width: 400px;
    font-size: 12px;
    line-height: 1.4;
}

.activity-performer {
    font-size: 12px;
    color: #555;
}

/* =============================================
   INVOICE UPDATED INDICATOR IN MODAL HEADER
   ============================================= */

.invoice-updated-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background-color: #e8f4fc;
    border: 1px solid #3c8dbc;
    border-radius: 4px;
    font-size: 12px;
    color: #3c8dbc;
}

.invoice-updated-indicator i {
    color: #3c8dbc;
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (max-width: 768px) {
    .enhanced-activities-section .table {
        font-size: 11px;
    }
    
    .activity-description {
        max-width: 200px;
    }
    
    .activity-action .label {
        font-size: 10px;
        padding: 2px 5px;
    }
}

/* =============================================
   PRINT STYLES - HIDE VISUAL INDICATORS
   ============================================= */

@media print {
    .invoice-updated-badge,
    .invoice-updated-indicator,
    .toggle-diff-details,
    .diff-details {
        display: none !important;
    }
    
    .invoice-updated-row {
        background-color: transparent !important;
        border-left: none !important;
    }
    
    .activity-row {
        border-left: none !important;
    }
}
