/* css/components/_relationship-modal.css */
/* 关系管理模态框样式（从 js/family-editor/ui/relationship-modal.css 迁移） */

.relationship-modal {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

.relationship-modal .modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 85vh;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.relationship-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
}

.relationship-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.relationship-modal .modal-header .icon {
    font-size: 24px;
}

.relationship-modal .modal-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.relationship-modal .modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.relationship-modal .modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 人员信息卡片 */
.person-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.person-avatar-large {
    font-size: 48px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.person-details h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.person-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
}

/* 无选择消息 */
.no-selection-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.message-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.message-text h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.message-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* 标签页样式 */
.relationship-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 4px;
    background: #f5f7fa;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 添加关系选项 */
.add-relationship-options {
    padding: 10px 0;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.relationship-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s;
    cursor: pointer;
}

.relationship-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.option-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.option-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.option-content p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.option-content .btn.small {
    padding: 6px 16px;
    font-size: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.option-content .btn.small:hover {
    background: #5a6fd8;
}

/* 快速添加部分 */
.quick-add-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.quick-add-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #333;
}

.quick-add-options {
    display: flex;
    gap: 12px;
}

.quick-add-options .btn.outline {
    flex: 1;
    padding: 12px 16px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.quick-add-options .btn.outline:hover {
    background: #667eea;
    color: white;
}

/* 查看关系样式 */
.view-relationships {
    padding: 10px 0;
}

.relationship-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.relationship-lists {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.relationship-list {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
}

.relationship-list h5 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.relationship-list .list-items {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
}

.empty-list {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

.relationship-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.relationship-item:hover {
    background: #f8f9fa;
}

.relationship-item:last-child {
    border-bottom: none;
}

.person-avatar-small {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
}

.relationship-item .person-info {
    flex: 1;
}

.relationship-item .person-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.relationship-item .person-meta {
    font-size: 12px;
    color: #999;
}

.relationship-item .person-meta .meta {
    margin-right: 8px;
}

.relationship-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.relationship-item:hover .relationship-actions {
    opacity: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #667eea;
    color: white;
}

.btn-icon.warning:hover {
    background: #f56c6c;
}

/* 管理关系样式 */
.manage-relationships {
    padding: 10px 0;
}

.manage-relationships .section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
}

.manage-relationships .section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.manage-relationships h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-actions {
    display: flex;
    gap: 12px;
}

.batch-actions .btn.outline {
    flex: 1;
    padding: 12px 16px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.batch-actions .btn.outline:hover {
    background: #667eea;
    color: white;
}

.batch-actions .btn.outline.warning {
    border-color: #e6a23c;
    color: #e6a23c;
}

.batch-actions .btn.outline.warning:hover {
    background: #e6a23c;
    color: white;
}

.advanced-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.advanced-actions .btn.small.outline {
    padding: 8px 12px;
    background: white;
    border: 1px solid #dcdfe6;
    color: #606266;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    transition: all 0.3s;
}

.advanced-actions .btn.small.outline:hover {
    border-color: #667eea;
    color: #667eea;
}

.advanced-actions .btn.small.outline.warning {
    border-color: #f56c6c;
    color: #f56c6c;
}

.advanced-actions .btn.small.outline.warning:hover {
    background: #f56c6c;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-detail .label {
    font-size: 14px;
    color: #666;
}

.stat-detail .value {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

/* 模态框底部 */
.relationship-modal .modal-footer {
    padding: 20px 24px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.relationship-modal .modal-footer .btn {
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.relationship-modal .modal-footer .btn:hover {
    background: #5a6fd8;
}

.relationship-modal .modal-footer .btn.secondary {
    background: #909399;
}

.relationship-modal .modal-footer .btn.secondary:hover {
    background: #7c7f85;
}

/* 空状态 */
.tab-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.tab-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .relationship-modal .modal-container {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .relationship-lists {
        grid-template-columns: 1fr;
    }
    
    .relationship-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .batch-actions {
        flex-direction: column;
    }
    
    .quick-add-options {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
.relationship-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.relationship-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.relationship-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.relationship-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.relationship-list .list-items::-webkit-scrollbar {
    width: 6px;
}

.relationship-list .list-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}
