﻿/* claims-cards.css - Claims cards alternate view */

/* ========== Claims Cards View Styles ========== */
.claims-cards-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

.claims-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.claims-cards-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.claims-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.25rem;
    padding-top: 1.25rem;
}

@media (max-width: 1400px) { .claims-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .claims-cards-grid { grid-template-columns: 1fr; } }

.claim-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    overflow: visible;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.claim-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #198754, #20c997);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.claim-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.claim-card:hover::before {
    opacity: 1;
}

/* Status-based background colors (like drafts) */
.claim-card.status-funded {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.claim-card.status-funded::before {
    background: linear-gradient(90deg, #198754, #22c55e);
    opacity: 1;
}

.claim-card.status-in-process {
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.claim-card.status-in-process::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    opacity: 1;
}

.claim-card.status-closed {
    background: linear-gradient(145deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #e5e7eb;
}

.claim-card.status-closed::before {
    background: linear-gradient(90deg, #6b7280, #9ca3af);
    opacity: 1;
}

.claim-card.status-withdrawn {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.claim-card.status-withdrawn::before {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    opacity: 1;
}

.claim-card-header {
    padding: 1rem 1rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.claim-card-id {
    font-size: 0.7rem;
    font-weight: 600;
    color: #198754;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'SF Mono', monospace;
}

.claim-card-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.claim-card-status.funded {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.claim-card-status.in-process {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.claim-card-status.closed {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #4b5563;
}

.claim-card-body {
    padding: 0 1rem 0.75rem;
    display: flex;
    gap: 1rem;
    flex: 1;
}

.claim-card-info {
    flex: 1;
    min-width: 0;
}

.claim-card-ledger {
    width: 110px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px dashed rgba(0,0,0,0.1);
}

.claim-ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.7rem;
}

.claim-ledger-row:not(:last-child) {
    border-bottom: 1px dashed #e5e7eb;
}

.claim-ledger-label {
    color: #6b7280;
}

.claim-ledger-value {
    font-weight: 600;
    font-family: 'SF Mono', monospace;
    font-size: 0.75rem;
}

.claim-ledger-row.gross .claim-ledger-value {
    color: #374151;
}

.claim-ledger-row.fee .claim-ledger-label,
.claim-ledger-row.fee .claim-ledger-value {
    color: #dc2626;
}

.claim-ledger-row.net {
    border-top: 2px solid #198754;
    border-bottom: none;
    margin-top: 0.25rem;
    padding-top: 0.35rem;
}

.claim-ledger-row.net .claim-ledger-label {
    color: #198754;
    font-weight: 600;
}

.claim-ledger-row.net .claim-ledger-value {
    color: #198754;
    font-size: 0.85rem;
    font-weight: 700;
}

.claim-card-decedent {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.claim-card-decedent i {
    color: #6b7280;
    font-size: 0.8rem;
}

.claim-card-info-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.claim-card-info-row i {
    width: 14px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.7rem;
}

.claim-card-info-row strong {
    color: #374151;
}

.claim-card-policies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.claim-card-policy-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(22, 101, 52, 0.2);
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 500;
    color: #166534;
}

.claim-card-policy-chip i {
    font-size: 0.55rem;
}

.claim-card-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 8px;
    margin-top: 0.75rem;
}

.claim-card-amount-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.claim-card-amount-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #198754;
}

.claim-card-footer {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.claim-card-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.claim-card-btn.view {
    background: #198754;
    color: #fff;
}

.claim-card-btn.view:hover {
    background: #157347;
}

.claim-card-btn.message {
    background: #3b82f6;
    color: #fff;
}

.claim-card-btn.message:hover {
    background: #2563eb;
}

.claim-card-btn.docs {
    background: #f3f4f6;
    color: #374151;
}

.claim-card-btn.docs:hover {
    background: #e5e7eb;
}

/* Dynamic Message Button States for Cards */
.claim-card-btn.claim-card-msg-new {
    background: #f3f4f6;
    color: #6b7280;
}

.claim-card-btn.claim-card-msg-new:hover {
    background: #e5e7eb;
    color: #374151;
}

.claim-card-btn.claim-card-msg-active {
    background: #3b82f6;
    color: #fff;
}

.claim-card-btn.claim-card-msg-active:hover {
    background: #2563eb;
}

.claim-card-btn.claim-card-msg-unread {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    position: relative;
    animation: claim-card-pulse 2s infinite;
}

.claim-card-btn.claim-card-msg-unread:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

@keyframes claim-card-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

.claim-card-msg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-bounce 0.5s ease;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Claim Status Step Indicator for Cards */
.claim-card-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.5);
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.claim-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.claim-step-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1;
}

.claim-step.pending .claim-step-dot {
    background: #f3f4f6;
    color: #9ca3af;
    border: 2px solid #d1d5db;
}

.claim-step.current .claim-step-dot {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.claim-step.completed .claim-step-dot {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: 2px solid #22c55e;
}

.claim-step-label {
    font-size: 0.55rem;
    font-weight: 500;
    margin-top: 0.25rem;
    text-align: center;
}

.claim-step.pending .claim-step-label {
    color: #9ca3af;
}

.claim-step.current .claim-step-label {
    color: #3b82f6;
    font-weight: 600;
}

.claim-step.completed .claim-step-label {
    color: #16a34a;
}

.claim-step-connector {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.claim-step:last-child .claim-step-connector {
    display: none;
}

.claim-step.completed .claim-step-connector {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.claim-step.current .claim-step-connector {
    background: linear-gradient(90deg, #3b82f6 50%, #e5e7eb 50%);
}

/* Claim Card Inline Financial Calculation */
.claim-card-calc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 8px;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.claim-calc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.5rem;
}

.claim-calc-label {
    font-size: 0.55rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
}

.claim-calc-value {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.claim-calc-item.gross .claim-calc-value {
    color: #374151;
}

.claim-calc-item.fee .claim-calc-value {
    color: #dc2626;
}

.claim-calc-item.net .claim-calc-value {
    color: #198754;
    font-size: 0.95rem;
    font-weight: 700;
}

.claim-calc-operator {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
    padding: 0 0.15rem;
}

.claim-calc-operator.minus {
    color: #dc2626;
}

.claim-calc-operator.equals {
    color: #198754;
}

/* AI Anomaly Badge for Claim Cards */
.claim-card-ai-alert {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 3px solid #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    animation: ai-alert-glow 2s infinite;
}

.claim-card-ai-alert:hover {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
}

.claim-card-ai-alert i {
    font-size: 0.85rem;
    animation: ai-robot-bounce 1s infinite;
}

@keyframes ai-alert-glow {
    0%, 100% { box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4), 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4), 0 0 0 6px rgba(245, 158, 11, 0); }
}

@keyframes ai-robot-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.claim-card-ai-alert.critical {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
    animation: ai-alert-critical 1.5s infinite;
}

.claim-card-ai-alert.critical i {
    animation: ai-robot-shake 0.5s infinite;
}

@keyframes ai-alert-critical {
    0%, 100% { box-shadow: 0 2px 8px rgba(220, 38, 38, 0.5), 0 0 0 0 rgba(220, 38, 38, 0.5); }
    50% { box-shadow: 0 2px 8px rgba(220, 38, 38, 0.5), 0 0 0 8px rgba(220, 38, 38, 0); }
}

@keyframes ai-robot-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.claim-card-ai-alert.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    animation: none;
}

.claim-card-ai-alert.info i {
    animation: none;
}

/* Cards with AI alerts - no margin to keep grid alignment */
.claim-card.has-ai-alert .claim-card-header {
    padding-top: 0.75rem;
}

/* AI Alert Tooltip - appears BELOW the badge */
.claim-card-ai-alert .ai-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 12px;
    padding: 0.85rem 1rem;
    background: linear-gradient(145deg, #1f2937, #111827);
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
    text-shadow: none;
    min-width: 240px;
    max-width: 300px;
    white-space: normal;
    text-align: left;
    line-height: 1.5;
    pointer-events: none;
}

/* Arrow pointing UP to the badge */
.claim-card-ai-alert .ai-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: #1f2937;
}

.claim-card-ai-alert:hover .ai-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
    pointer-events: auto;
}

.ai-tooltip-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.ai-tooltip-title i {
    font-size: 1rem;
}

.ai-tooltip-content {
    color: #d1d5db;
}

.ai-tooltip-action {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #60a5fa;
    font-size: 0.7rem;
}

.ai-tooltip-action i {
    margin-right: 0.25rem;
}
