/**
 * 世系图交互控制样式
 * 支持缩放、拖动、全屏、详情弹窗
 */

/* 缩放容器 */
.pedigree-viewport {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: 12px;
    cursor: grab;
    user-select: none;
}

.pedigree-viewport:active {
    cursor: grabbing;
}

/* 可变换的世系图容器 */
.pedigree-transform-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transition: none;
    will-change: transform;
    white-space: nowrap;
}

/* 工具提示 */
.pedigree-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
    z-index: 100;
    opacity: 0.8;
}

.pedigree-hint i {
    margin-right: 5px;
}

/* 控制按钮 */
.pedigree-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.pedigree-controls button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #333;
}

.pedigree-controls button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.pedigree-controls button:active {
    transform: scale(0.95);
}

/* 缩放比例显示 */
.pedigree-zoom-level {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 100;
}

/* 全屏样式 */
.pedigree-viewport.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100 !important;
    border-radius: 0 !important;
}

/* 全屏模式下隐藏控制按钮 */
body.fullscreen-mode .pedigree-controls {
    z-index: 101;
}

body.fullscreen-mode .pedigree-zoom-level,
body.fullscreen-mode .pedigree-hint {
    z-index: 101;
}

/* 详情弹窗 - 确保在最上层 */
.pedigree-detail-modal {
    z-index: 10000 !important;
}

.pedigree-detail-modal.show {
    display: block !important;
}

.pedigree-detail-modal .modal-dialog {
    z-index: 10001 !important;
}

/* 模态框背景 */
.modal-backdrop.show {
    z-index: 9999 !important;
}

/* 响应式 */
@media (max-width: 768px) {
    .pedigree-viewport {
        height: 400px;
    }

    .pedigree-controls button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .pedigree-hint {
        font-size: 10px;
        padding: 6px 12px;
    }
}
