/* =====================================================
   FAMILY HISTORY CARD STYLES
   ===================================================== */

/* Family card - purple theme */
.timeline-card.family {
    border-left-color: #9c27b0;
    background: white;
    transition: all 0.2s ease;
}

.timeline-card.family:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.15);
}

/* Family icon */
.timeline-icon.family {
    background: #f3e5f5;
    color: #9c27b0;
}

.timeline-icon.family .material-symbols-rounded {
    font-size: 24px;
}

/* Action badge for family */
.action-badge.family {
    background: #f3e5f5;
    color: #9c27b0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    display: inline-block;
    vertical-align: middle;
}

/* Family ID badges */
.family-id-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    margin-right: 8px;
}

/* Client ID pills */
.detail-item strong:contains("Client A ID"),
.detail-item strong:contains("Client B ID") {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    margin-right: 4px;
}

/* Family relationship display */
.family-relationship {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #faf5ff;
    padding: 10px 16px;
    border-radius: 30px;
    margin: 8px 0;
    border: 1px solid #e9d5ff;
}

.family-member {
    font-weight: 600;
    color: #333;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(156, 39, 176, 0.1);
    font-size: 13px;
}

.family-member strong {
    color: #9c27b0;
    font-weight: 700;
}

.family-relation {
    color: #9c27b0;
    font-weight: 600;
    background: #f3e5f5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    text-transform: lowercase;
}

.family-arrow {
    color: #9c27b0;
    font-size: 18px;
    font-weight: 300;
    margin: 0 4px;
}

/* Reverse relationship styling */
.family-reverse {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-left: 3px solid #9c27b0;
    width: 100%;
}

.family-reverse strong {
    color: #9c27b0;
    font-weight: 600;
    margin-right: 4px;
}

/* Fix for the 0 values (when relationship is missing) */
.family-relation:contains("0") {
    background: #fee2e2;
    color: #dc2626;
    font-style: italic;
}

.family-relation:contains("0")::before {
    content: "⚠️ ";
    font-size: 12px;
}

/* Detail items in family card */
.timeline-card.family .detail-item {
    background: transparent;
    padding: 4px 0;
    margin-right: 12px;
}

.timeline-card.family .detail-item strong {
    color: #9c27b0;
    margin-right: 8px;
    min-width: 80px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 640px) {
    .family-relationship {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 16px;
    }
    
    .family-member, .family-relation {
        width: 100%;
        text-align: center;
    }
    
    .family-arrow {
        transform: rotate(90deg);
        margin: 4px 0;
    }
    
    .family-reverse {
        width: 100%;
        text-align: center;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .timeline-card.family .detail-item {
        width: 100%;
        margin-bottom: 4px;
    }
}

/* Special styling for the 0 relationship warning */
.family-relation[data-relation="0"] {
    background: #fee2e2;
    color: #b91c1c;
}

/* Client ID chips */
.client-id-chip {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
}